__( 'Main Menu', 'maxstore' ), ) ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(300,300, true); add_image_size( 'maxstore-single', 848, 400, true ); add_image_size( 'maxstore-home-top', 300, 300, true ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'woocommerce' ); // Display a admin notices add_action('admin_notices', 'maxstore_admin_notice'); function maxstore_admin_notice() { global $current_user; $user_id = $current_user->ID; /* Check that the user hasn't already clicked to ignore the message */ if ( ! get_user_meta($user_id, 'maxstore_ignore_notice') ) { echo '

'; printf(__('Like MaxStore theme? You will LOVE MaxStore PRO! ','maxstore').''.__('Click here for all the exciting features.','maxstore').'', '?maxstore_notice_ignore=0'); echo "

"; } } add_action('admin_init', 'maxstore_notice_ignore'); function maxstore_notice_ignore() { global $current_user; $user_id = $current_user->ID; /* If user clicks to ignore the notice, add that to their user meta */ if ( isset($_GET['maxstore_notice_ignore']) && '0' == $_GET['maxstore_notice_ignore'] ) { add_user_meta($user_id, 'maxstore_ignore_notice', 'true', true); } } add_action( 'customize_controls_print_footer_scripts', 'maxstore_pro_banner' ); function maxstore_pro_banner() { echo ''; echo ''; } } endif; //////////////////////////////////////////////////////////////////// // Enqueue Styles (normal style.css and bootstrap.css) //////////////////////////////////////////////////////////////////// function maxstore_theme_stylesheets() { wp_enqueue_style('maxstore-bootstrap-css', get_template_directory_uri() . '/css/bootstrap.css', array(), '1', 'all' ); wp_enqueue_style( 'maxstore-stylesheet', get_stylesheet_uri(), array(), '1', 'all' ); // load Font Awesome css wp_enqueue_style( 'maxstore-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', false ); } add_action('wp_enqueue_scripts', 'maxstore_theme_stylesheets'); //////////////////////////////////////////////////////////////////// // Register Bootstrap JS with jquery //////////////////////////////////////////////////////////////////// function maxstore_theme_js() { wp_enqueue_script('maxstore-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.js',array( 'jquery' ),true ); wp_enqueue_script('maxstore-theme-js', get_template_directory_uri() . '/js/customscript.js',array( 'jquery' ),true ); } add_action('wp_enqueue_scripts', 'maxstore_theme_js'); //////////////////////////////////////////////////////////////////// // Register Custom Navigation Walker include custom menu widget to use walkerclass //////////////////////////////////////////////////////////////////// require_once('lib/wp_bootstrap_navwalker.php'); //////////////////////////////////////////////////////////////////// // Register Widgets //////////////////////////////////////////////////////////////////// add_action( 'widgets_init', 'maxstore_widgets_init' ); function maxstore_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'maxstore' ), 'id' => 'maxstore-right-sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => __( 'Left Sidebar', 'maxstore' ), 'id' => 'maxstore-left-sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => __( 'Footer Section', 'maxstore' ), 'id' => 'maxstore-footer-area', 'description' => __( 'Content Footer Section', 'maxstore' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } //////////////////////////////////////////////////////////////////// // Register hook and action to set Main content area col-md- width based on sidebar declarations //////////////////////////////////////////////////////////////////// add_action( 'maxstore_main_content_width_hook', 'maxstore_main_content_width_columns'); function maxstore_main_content_width_columns () { $columns = '12'; if (get_theme_mod( 'rigth-sidebar-check', 1 ) != 0 ) { $columns = $columns - esc_attr(get_theme_mod( 'right-sidebar-size', 3 )); } if (get_theme_mod( 'left-sidebar-check', 0 ) != 0 ) { $columns = $columns - esc_attr(get_theme_mod( 'left-sidebar-size', 3 )); } echo $columns; } function maxstore_main_content_width() { do_action('maxstore_main_content_width_hook'); } //////////////////////////////////////////////////////////////////// // Set Content Width //////////////////////////////////////////////////////////////////// if ( ! isset( $content_width ) ) $content_width = 800; //////////////////////////////////////////////////////////////////// // Theme Info page //////////////////////////////////////////////////////////////////// if (is_admin()) { require_once(trailingslashit( get_template_directory() ) . '/lib/theme-info.php'); } //////////////////////////////////////////////////////////////////// // Breadcrumbs //////////////////////////////////////////////////////////////////// function maxstore_breadcrumb () { global $post, $wp_query; // schema link $home = __('Home', 'maxstore'); $delimiter = ' » '; $homeLink = home_url(); if (is_home() || is_front_page()) { // no need for breadcrumbs in homepage } else { echo ''; } } //////////////////////////////////////////////////////////////////// // Display navigation to next/previous pages when applicable //////////////////////////////////////////////////////////////////// if ( ! function_exists( 'maxstore_content_nav' ) ) : function maxstore_content_nav( $nav_id ) { global $wp_query, $post; // Don't print empty markup on single pages if there's nowhere to navigate. if ( is_single() ) { $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) return; $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; ?> __( 'Facebook', 'maxstore' ), 'twp_social_twitter' => __( 'Twitter', 'maxstore' ), 'twp_social_google' => __( 'Google-Plus' , 'maxstore' ), 'twp_social_instagram' => __( 'Instagram', 'maxstore' ), 'twp_social_pin' => __( 'Pinterest', 'maxstore' ), 'twp_social_youtube' => __( 'YouTube', 'maxstore' ), 'twp_social_reddit' => __( 'Reddit', 'maxstore' ), ); ?> str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?page=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages, 'prev_next' => false, 'type' => 'array', 'prev_next' => TRUE, 'prev_text' => __('← Previous','maxstore' ), 'next_text' => __('Next →','maxstore' ), )); if (is_array($pages)) { $current_page = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); echo ''; } } //////////////////////////////////////////////////////////////////// // WooCommerce section //////////////////////////////////////////////////////////////////// if ( class_exists( 'WooCommerce' ) ) { //////////////////////////////////////////////////////////////////// // WooCommerce header cart //////////////////////////////////////////////////////////////////// if ( ! function_exists( 'maxstore_cart_link' ) ) { function maxstore_cart_link() { ?> cart->get_cart_contents_count();?>cart->get_cart_subtotal() ); ?> get_wishlist_url(); ?>
id ); $id = $product->id; $wishlist_url = YITH_WCWL()->get_wishlist_url(); ?>
loading
is_search()) { // category terms search. if (isset($_GET['category']) && !empty($_GET['category'])) { $query->set('tax_query', array(array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => array($_GET['category']) ) )); } return $query; } } add_action('pre_get_posts', 'maxstore_advanced_search_query', 1000); } //////////////////////////////////////////////////////////////////// // WooCommerce end ////////////////////////////////////////////////////////////////////