Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.136.18.192
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/diixadigital.com/wp-content/themes/meto/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/diixadigital.com/wp-content/themes/meto/functions.php
<?php

require_once get_template_directory() . '/includes/loader.php';

add_action('after_setup_theme', 'meto_setup_theme');
add_action('after_setup_theme', 'meto_load_default_hooks');


function meto_setup_theme()
{
    load_theme_textdomain('meto', get_template_directory() . '/languages');

    // Add default posts and comments RSS feed links to head.

    /*
     * Let WordPress manage the document title.
     * By adding theme support, we declare that this theme does not use a
     * hard-coded <title> tag in the document head, and expect WordPress to
     * provide it for us.
     */
    add_theme_support('title-tag');
    add_theme_support('custom-header');
    add_theme_support('custom-background');

    /*
     * Enable support for Post Thumbnails on posts and pages.
     *
     * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
     */
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
    add_theme_support('wp-block-styles');
    add_theme_support('align-wide');
    add_theme_support('wp-block-styles');
    add_theme_support('editor-styles');
    add_theme_support('post', 'page-attributes');


    // Set the default content width.
    $GLOBALS['content_width'] = 525;

    //Register image sizes
    
    add_image_size('meto_112x112', 112, 112, true); //'meto_112x112 Our Testimonials'
	add_image_size('meto_350x470', 350, 470, true); //'meto_350x470 Our Team'
	add_image_size('meto_370x250', 370, 250, true); //'meto_370x250 Latest News '
	add_image_size('meto_420x370', 420, 370, true); //'meto_420x370 Recent Projects'
	add_image_size('meto_500x330', 500, 330, true); //'meto_500x330 Latest News V3'

    // This theme uses wp_nav_menu() in two locations.
    register_nav_menus(array(
        'topbar_menu' => esc_html__('TopBar Menu', 'meto'),
		'main_menu' => esc_html__('Main Menu', 'meto'),
		'onepage_menu' => esc_html__('OnePage Menu', 'meto'),
		'rtl_page_menu' => esc_html__('RTL Page Menu', 'meto'),
		'footer_menu' => esc_html__('Footer Menu', 'meto'),
    ));

    /*
     * Switch default core markup for search form, comment form, and comments
     * to output valid HTML5.
     */
    add_theme_support('html5', array(
        'comment-form',
        'comment-list',
        'gallery',
        'caption',
    ));

    // Add theme support for Custom Logo.
    add_theme_support('custom-logo', array(
        'width'      => 250,
        'height'     => 250,
        'flex-width' => true,
    ));

    // Add theme support for selective refresh for widgets.
    add_theme_support('customize-selective-refresh-widgets');

    /*
     * This theme styles the visual editor to resemble the theme style,
     * specifically font, colors, and column width.
     */
    add_editor_style();
    add_action('admin_init', 'meto_admin_init', 2000000);
}

function meto_gutenberg_editor_palette_styles()
{
    add_theme_support('editor-color-palette', array(
        array(
            'name' => esc_html__('strong yellow', 'meto'),
            'slug' => 'strong-yellow',
            'color' => '#f7bd00',
        ),
        array(
            'name' => esc_html__('strong white', 'meto'),
            'slug' => 'strong-white',
            'color' => '#fff',
        ),
        array(
            'name' => esc_html__('light black', 'meto'),
            'slug' => 'light-black',
            'color' => '#242424',
        ),
        array(
            'name' => esc_html__('very light gray', 'meto'),
            'slug' => 'very-light-gray',
            'color' => '#797979',
        ),
        array(
            'name' => esc_html__('very dark black', 'meto'),
            'slug' => 'very-dark-black',
            'color' => '#000000',
        ),
    ));

    add_theme_support('editor-font-sizes', array(
        array(
            'name' => esc_html__('Small', 'meto'),
            'size' => 10,
            'slug' => 'small'
        ),
        array(
            'name' => esc_html__('Normal', 'meto'),
            'size' => 15,
            'slug' => 'normal'
        ),
        array(
            'name' => esc_html__('Large', 'meto'),
            'size' => 24,
            'slug' => 'large'
        ),
        array(
            'name' => esc_html__('Huge', 'meto'),
            'size' => 36,
            'slug' => 'huge'
        )
    ));
}
add_action('after_setup_theme', 'meto_gutenberg_editor_palette_styles');

/**
 * [meto_widgets_init]
 *
 * @param  array $data [description]
 *
 * @return [type]       [description]
 */
function meto_widgets_init()
{
    global $wp_registered_sidebars;

    $theme_options = get_theme_mod(METO_NAME . '_options-mods');

    register_sidebar(array(
        'name'          => esc_html__('Default Sidebar', 'meto'),
        'id'            => 'default-sidebar',
        'description'   => esc_html__('Widgets in this area will be shown on the right-hand side.', 'meto'),
        'before_widget' => '<div id="%1$s" class="widget sidebar-widget single-sidebar %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="sidebar-title"><h5>',
        'after_title'   => '</h5></div>',
    ));
    register_sidebar(array(
        'name' => esc_html__('Footer Widget', 'meto'),
        'id' => 'footer-sidebar',
        'description' => esc_html__('Widgets in this area will be shown in Footer Area.', 'meto'),
        'before_widget'=>'<div class="col-lg-3 col-md-6 col-sm-12 footer-column"><div id="%1$s" class="footer-widget %2$s">',
        'after_widget'=>'</div></div>',
        'before_title' => '<h4>',
        'after_title' => '</h4>'
    ));
    if (class_exists('\Elementor\Plugin')) {
        register_sidebar(array(
        'name' => esc_html__('Footer Widget Two', 'meto'),
        'id' => 'footer-sidebar-2',
        'description' => esc_html__('Widgets in this area will be shown in Footer Area.', 'meto'),
        'before_widget'=>'<div class="col-lg-3 col-md-6 col-sm-12 footer-column"><div id="%1$s" class="footer-widget %2$s">',
        'after_widget'=>'</div></div>',
        'before_title' => '<h4>',
        'after_title' => '</h4>'
    ));
	register_sidebar(array(
        'name' => esc_html__('RTL Page Footer Widget', 'meto'),
        'id' => 'footer-sidebar-3',
        'description' => esc_html__('Widgets in this area will be shown in RTL Page Footer.', 'meto'),
        'before_widget'=>'<div class="col-lg-3 col-md-6 col-sm-12 footer-column"><div id="%1$s" class="footer-widget %2$s">',
        'after_widget'=>'</div></div>',
        'before_title' => '<h4>',
        'after_title' => '</h4>'
    ));
    register_sidebar(array(
        'name' => esc_html__('Services Widget', 'meto'),
        'id' => 'service-sidebar',
        'description' => esc_html__('Widgets in this area will be shown in Services Area.', 'meto'),
        'before_widget'=>'<div id="%1$s" class="service-widget %2$s">',
        'after_widget'=>'</div>',
        'before_title' => '<div class="widget-title"><h4>',
        'after_title' => '</h4></div>'
    ));
    }
    register_sidebar(array(
      'name' => esc_html__('Blog Listing', 'meto'),
      'id' => 'blog-sidebar',
      'description' => esc_html__('Widgets in this area will be shown on the right-hand side.', 'meto'),
      'before_widget'=>'<div id="%1$s" class="widget sidebar-widget %2$s">',
      'after_widget'=>'</div>',
      'before_title' => '<div class="sidebar-title"><h5>',
      'after_title' => '</h5></div>'
    ));
    if (! is_object(meto_WSH())) {
        return;
    }

    $sidebars = meto_set($theme_options, 'custom_sidebar_name');

    foreach (array_filter((array) $sidebars) as $sidebar) {
        if (meto_set($sidebar, 'topcopy')) {
            continue;
        }

        $name = $sidebar;
        if (! $name) {
            continue;
        }
        $slug = str_replace(' ', '_', $name);

        register_sidebar(array(
            'name'          => $name,
            'id'            => sanitize_title($slug),
            'before_widget' => '<div id="%1$s" class="%2$s sidebar-widget ">',
            'after_widget'  => '</div>',
            'before_title'  => '<div class="sidebar-title"><h5>',
            'after_title'   => '</h5></div>',
        ));
    }

    update_option('wp_registered_sidebars', $wp_registered_sidebars);
}

add_action('widgets_init', 'meto_widgets_init');

/**
 * [meto_admin_init]
 *
 * @param  array $data [description]
 *
 * @return [type]       [description]
 */


function meto_admin_init()
{
    remove_action('admin_notices', array( 'ReduxFramework', '_admin_notices' ), 99);
}

/**
 * [meto_set description]
 *
 * @param  array $data [description]
 *
 * @return [type]       [description]
 */
if (! function_exists('meto_set')) {
    function meto_set($var, $key, $def = '')
    {
        //if( ! $var ) return false;

        if (is_object($var) && isset($var->$key)) {
            return $var->$key;
        } elseif (is_array($var) && isset($var[ $key ])) {
            return $var[ $key ];
        } elseif ($def) {
            return $def;
        } else {
            return false;
        }
    }
}
function meto_add_editor_styles()
{
    add_editor_style('editor-style.css');
}
add_action('admin_init', 'meto_add_editor_styles');

// Add specific CSS class by filter.
$options = meto_WSH()->option();
if (meto_set($options, 'boxed_wrapper')) {
    add_filter('body_class', function ($classes) {
        $classes[] = 'boxed_wrapper';
        return $classes;
    });
}


/**
 * Load WooCommerce compatibility file.
 */
if (class_exists('woocommerce')) {
    require get_template_directory() . '/includes/woocommerce/woocommerce.php';
}

function meto_admin_style()
{
    wp_enqueue_style('admin-styles', get_template_directory_uri().'/assets/css/admin.css');
    wp_enqueue_media();
    wp_enqueue_script('meto-admin-scripts', get_template_directory_uri().'/assets/js/admin.js', array('jquery'), false, true);
    wp_enqueue_script('meto-upload-img', get_template_directory_uri() . '/assets/js/img_upload.js', array('jquery'), false, true);
}
add_action('admin_enqueue_scripts', 'meto_admin_style');



function meto_enqueue_scripts()
{
    $options = meto_WSH()->option();
    $custom_color = $options->get('meto_custom_color');
    

    if(isset($custom_color) && $custom_color == 'yes') {
        $maincolor = str_replace('#', '',$options->get('main_color_scheme', '#0a2aa6'));
        $seccolor = str_replace('#', '',$options->get('main_sec_color_scheme', '#d71800'));
    } else {
        $maincolor = str_replace('#', '', '#0a2aa6');
        $seccolor = str_replace('#', '', '#d71800');
    }

    wp_enqueue_style('meto-main-colors', get_template_directory_uri() . '/assets/css/color.php?main_color='.$maincolor.'&seccolor='.$seccolor);
}

add_action('wp_enqueue_scripts', 'meto_enqueue_scripts', 14);

Youez - 2016 - github.com/yon3zu
LinuXploit