__( 'Main Menu', 'alpha-store' ), 'top_menu' => __( 'Top Menu', 'alpha-store' ), ) ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 300, 300, true ); add_image_size( 'alpha-store-single', 688, 325, true ); add_image_size( 'alpha-store-carousel', 270, absint( get_theme_mod( 'carousel-height', 423 ) ), true ); add_image_size( 'alpha-store-category', 600, 600, true ); add_image_size( 'alpha-store-widget', 60, 60, true ); // Add Custom logo Support add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 400, 'flex-height' => true, 'flex-width' => true, ) ); // Add Custom Background Support $args = array( 'default-color' => 'ffffff', ); add_theme_support( 'custom-background', $args ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'woocommerce' ); } endif; //////////////////////////////////////////////////////////////////// // Display a admin notices //////////////////////////////////////////////////////////////////// add_action( 'admin_notices', 'alpha_store_admin_notice' ); function alpha_store_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, 'alpha_store_ignore_notice' ) ) { echo '

'; printf( __( 'Like Alpha Store theme? You will LOVE Alpha Store PRO! ', 'alpha-store' ) . '' . __( 'Click here for all the exciting features.', 'alpha-store' ) . '', '?alpha_store_notice_ignore=0' ); echo "

"; } } add_action( 'admin_init', 'alpha_store_notice_ignore' ); function alpha_store_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[ 'alpha_store_notice_ignore' ] ) && '0' == $_GET[ 'alpha_store_notice_ignore' ] ) { add_user_meta( $user_id, 'alpha_store_ignore_notice', 'true', true ); } } //////////////////////////////////////////////////////////////////// // Enqueue Styles (normal style.css and bootstrap.css) //////////////////////////////////////////////////////////////////// function alpha_store_theme_stylesheets() { wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '3.3.4', 'all' ); wp_enqueue_style( 'alpha-store-stylesheet', get_stylesheet_uri(), array(), '1.2.7', 'all' ); // load Font Awesome css wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.6.3' ); wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), '2.6.3' ); } add_action( 'wp_enqueue_scripts', 'alpha_store_theme_stylesheets' ); //////////////////////////////////////////////////////////////////// // Register Bootstrap JS with jquery //////////////////////////////////////////////////////////////////// function alpha_store_theme_js() { wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array( 'jquery' ), '3.3.4' ); wp_enqueue_script( 'alpha-store-theme-js', get_template_directory_uri() . '/js/customscript.js', array( 'jquery' ), '1.0.2' ); wp_localize_script( 'alpha-store-theme-js', 'objectL10n', array( 'compare' => esc_html__( 'Compare Product', 'alpha-store' ), 'qview' => esc_html__( 'Quick View', 'alpha-store' ), ) ); wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array( 'jquery' ), '2.6.3' ); } add_action( 'wp_enqueue_scripts', 'alpha_store_theme_js' ); //////////////////////////////////////////////////////////////////// // Register Custom Navigation Walker include custom menu widget to use walkerclass //////////////////////////////////////////////////////////////////// require_once(trailingslashit( get_template_directory() ) . 'lib/wp_bootstrap_navwalker.php'); //////////////////////////////////////////////////////////////////// // Register Widgets //////////////////////////////////////////////////////////////////// add_action( 'widgets_init', 'alpha_store_widgets_init' ); function alpha_store_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'alpha-store' ), 'id' => 'alpha-store-right-sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

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

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Homepage Sidebar', 'alpha-store' ), 'id' => 'alpha-store-home-sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Section', 'alpha-store' ), 'id' => 'alpha-store-footer-area', 'description' => __( 'Content Footer Section', 'alpha-store' ), '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( 'alpha_store_main_content_width_hook', 'alpha_store_main_content_width_columns' ); function alpha_store_main_content_width_columns() { $columns = '12'; if ( get_theme_mod( 'rigth-sidebar-check', 1 ) != 0 ) { $columns = $columns - absint( get_theme_mod( 'right-sidebar-size', 3 ) ); } if ( get_theme_mod( 'left-sidebar-check', 0 ) != 0 ) { $columns = $columns - absint( get_theme_mod( 'left-sidebar-size', 3 ) ); } echo $columns; } function alpha_store_main_content_width() { do_action( 'alpha_store_main_content_width_hook' ); } //////////////////////////////////////////////////////////////////// // Theme Info page //////////////////////////////////////////////////////////////////// if ( is_admin() && !is_child_theme() ) { require_once( trailingslashit( get_template_directory() ) . 'lib/welcome/welcome-screen.php' ); } //////////////////////////////////////////////////////////////////// // Set Content Width //////////////////////////////////////////////////////////////////// function alpha_store_content_width() { $GLOBALS['content_width'] = apply_filters( 'alpha_store_content_width', 800 ); } add_action( 'after_setup_theme', 'alpha_store_content_width', 0 ); //////////////////////////////////////////////////////////////////// // Schema.org microdata //////////////////////////////////////////////////////////////////// function alpha_store_tag_schema() { $schema = 'http://schema.org/'; // Is single post if ( is_single() ) { $type = 'WebPage'; } // Is author page elseif ( is_author() ) { $type = 'ProfilePage'; } // Is search results page elseif ( is_search() ) { $type = 'SearchResultsPage'; } else { $type = 'WebPage'; } echo 'itemscope itemtype="' . $schema . $type . '"'; } if ( !function_exists( 'alpha_store_breadcrumb' ) ) : //////////////////////////////////////////////////////////////////// // Breadcrumbs //////////////////////////////////////////////////////////////////// function alpha_store_breadcrumb() { global $post, $wp_query; // schema link $schema_link = 'http://data-vocabulary.org/Breadcrumb'; $home = esc_html__( 'Home', 'alpha-store' ); $delimiter = ' » '; $homeLink = home_url(); if ( is_home() || is_front_page() ) { // no need for breadcrumbs in homepage } else { echo ''; } } endif; //////////////////////////////////////////////////////////////////// // Social links //////////////////////////////////////////////////////////////////// if ( !function_exists( 'alpha_store_social_links' ) ) : /** * This function is for social links display on header * * Get links through Theme Options */ function alpha_store_social_links() { $twp_social_links = array( 'twp_social_facebook' => 'facebook', 'twp_social_twitter' => 'twitter', 'twp_social_google' => 'google-plus', 'twp_social_instagram' => 'instagram', 'twp_social_pin' => 'pinterest', 'twp_social_youtube' => 'youtube', 'twp_social_reddit' => 'reddit', 'twp_social_linkedin' => 'linkedin', 'twp_social_skype' => 'skype', 'twp_social_vimeo' => 'vimeo', 'twp_social_flickr' => 'flickr', 'twp_social_dribble' => 'dribbble', 'twp_social_envelope-o' => 'envelope-o', 'twp_social_rss' => 'rss', ); ?> cart->get_cart_contents_count() ); ?>
cart->get_cart_subtotal() ); ?>
get_wishlist_url(); ?>
id ); $id = $product->id; $wishlist_url = YITH_WCWL()->get_wishlist_url(); ?>
loading
' » ', 'wrap_before' => '', 'before' => '', 'after' => '', 'home' => esc_html_x( 'Home', 'woocommerce breadcrumb', 'alpha-store' ), ); } add_filter( 'woocommerce_breadcrumb_defaults', 'alpha_store_woocommerce_breadcrumbs' ); if( !function_exists('alpha_store_my_account_text') ) : function alpha_store_my_account_text( $myaccount ){ $user_info = wp_get_current_user(); if ( !empty($user_info->first_name ) ) { $user_first_name = $user_info->first_name; } else { $user_first_name = $user_info->billing_first_name; } if ( !empty( $user_info->last_name ) ) { $user_last_name = $user_info->last_name; } else { $user_last_name = $user_info->billing_last_name; } return str_replace( array('{first-name}', '{last-name}'), array($user_first_name, $user_last_name), $myaccount ); } endif; add_filter( 'alpha_store_my_account', 'alpha_store_my_account_text' ); } //////////////////////////////////////////////////////////////////// // WooCommerce end //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// // Excerpt functions //////////////////////////////////////////////////////////////////// function alpha_store_excerpt_length( $length ) { return 25; } add_filter( 'excerpt_length', 'alpha_store_excerpt_length', 999 ); function alpha_store_excerpt_more( $more ) { return '…'; } add_filter( 'excerpt_more', 'alpha_store_excerpt_more' ); //////////////////////////////////////////////////////////////////// // Schema publisher function //////////////////////////////////////////////////////////////////// if ( !function_exists( 'alpha_store_entry_publisher' ) ) { function alpha_store_entry_publisher() { $image_id = get_theme_mod( 'custom_logo' ); $img = wp_get_attachment_image_src( $image_id, 'full' ); // Uncomment your choice below. $publisher = 'https://schema.org/Organization'; //$publisher = 'https://schema.org/Person'; $publisher_name = get_bloginfo( 'name', 'display' ); $logo = $img[0]; $logo_width = $img[1]; $logo_height = $img[2]; if ( ! isset( $publisher ) || ! isset( $logo ) || ! isset( $publisher_name ) ) { return; } printf( '
', esc_url( $publisher ) ); echo '
'; printf( '', esc_url( $logo ) ); printf( '', esc_attr( $logo_width ) ); printf( '', esc_attr( $logo_height ) ); echo '
'; printf( '', esc_attr( $publisher_name ) ); echo '
'; } }