8889841c 99,'thumbnail_image_width' => 90,) ); load_theme_textdomain( 'machic', get_template_directory() . '/languages' ); remove_theme_support( 'widgets-block-editor' ); } add_action( 'after_setup_theme', 'machic_theme_setup' ); /************************************************* ## Include the TGM_Plugin_Activation class. *************************************************/ require_once get_template_directory() . '/includes/class-tgm-plugin-activation.php'; add_action( 'tgmpa_register', 'machic_register_required_plugins' ); function machic_register_required_plugins() { $url = 'http://klbtheme.com/machic/plugins/'; $mainurl = 'http://klbtheme.com/plugins/'; $plugins = array( array( 'name' => esc_html__('Meta Box','machic'), 'slug' => 'meta-box', ), array( 'name' => esc_html__('Contact Form 7','machic'), 'slug' => 'contact-form-7', ), array( 'name' => esc_html__('WooCommerce Wishlist','machic'), 'slug' => 'ti-woocommerce-wishlist', ), array( 'name' => esc_html__('WooCommerce Compare','machic'), 'slug' => 'woo-smart-compare', ), array( 'name' => esc_html__('Kirki','machic'), 'slug' => 'kirki', ), array( 'name' => esc_html__('MailChimp Subscribe','machic'), 'slug' => 'mailchimp-for-wp', ), array( 'name' => esc_html__('Elementor','machic'), 'slug' => 'elementor', 'required' => true, ), array( 'name' => esc_html__('WooCommerce','machic'), 'slug' => 'woocommerce', 'required' => true, ), array( 'name' => esc_html__('Variation Swatches','machic'), 'slug' => 'woo-variation-swatches', ), array( 'name' => esc_html__('WP Ajax Search','machic'), 'slug' => 'ajax-search-for-woocommerce', ), array( 'name' => esc_html__('Machic Core','machic'), 'slug' => 'machic-core', 'source' => $url . 'machic-core.zip', 'required' => true, 'version' => '1.0.3', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', ), array( 'name' => esc_html__('Envato Market','machic'), 'slug' => 'envato-market', 'source' => $mainurl . 'envato-market.zip', 'required' => true, 'version' => '2.0.6', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', ), ); $config = array( 'id' => 'machic', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'parent_slug' => 'themes.php', // Parent menu slug. 'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); } /************************************************* ## Machic Register Menu *************************************************/ function machic_register_menus() { register_nav_menus( array( 'main-menu' => esc_html__('Primary Navigation Menu','machic')) ); $topheader = get_theme_mod('machic_top_header','0'); $sidebarmenu = get_theme_mod('machic_header_sidebar','0'); if($sidebarmenu == '1'){ register_nav_menus( array( 'sidebar-menu' => esc_html__('Sidebar Menu','machic')) ); } if($topheader == '1'){ register_nav_menus( array( 'canvas-bottom' => esc_html__('Canvas Bottom','machic')) ); register_nav_menus( array( 'top-right-menu' => esc_html__('Top Right Menu','machic')) ); register_nav_menus( array( 'top-left-menu' => esc_html__('Top Left Menu','machic')) ); } } add_action('init', 'machic_register_menus'); /************************************************* ## Machic Main Menu *************************************************/ class machic_main_walker extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) { // depth dependent classes $indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent $display_depth = ( $depth + 1); // because it counts the first submenu as 0 $classes = array( '', ( $display_depth % 2 ? '' : '' ), ( $display_depth >=2 ? '' : '' ), ); $class_names = implode( ' ', $classes ); // build html $output .= "\n" . $indent . '