__( 'AP: Right Sidebar', 'accesspress-store' ), 'id' => 'sidebar-right', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

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

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Shop Sidebar', 'accesspress-store' ), 'id' => 'shop', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '', 'after_title' => '', ) ); register_sidebar( array( 'name' => __( 'Header Call To Box', 'accesspress-store' ), 'id' => 'header-callto-action', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '', 'after_title' => '', ) ); register_sidebar( array( 'name' => __( 'AP: Promo Widget 1', 'accesspress-store' ), 'id' => 'promo-widget-1', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'AP: Product Listing Widget 1', 'accesspress-store' ), 'id' => 'product-widget-1', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'AP: Promo Widget 2', 'accesspress-store' ), 'id' => 'promo-widget-2', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'AP: Product Listing Widget 2', 'accesspress-store' ), 'id' => 'product-widget-2', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'AP: Video Call to Action', 'accesspress-store' ), 'id' => 'cta-video', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'AP: Product Listing Widget 3', 'accesspress-store' ), 'id' => 'product-widget-3', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'AP: Promo Widget 3', 'accesspress-store' ), 'id' => 'promo-widget-3', 'description' => 'You can use widget AP: Icon text block which is what it is designed that it will horizontally allign with 3 row', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area 1', 'accesspress-store' ), 'id' => 'footer-1', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area 2', 'accesspress-store' ), 'id' => 'footer-2', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area 3', 'accesspress-store' ), 'id' => 'footer-3', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area 4', 'accesspress-store' ), 'id' => 'footer-4', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'accesspress_store_widgets_init' ); /** * Enqueue scripts and styles. */ function accesspress_store_scripts() { $font_args = array( 'family' => 'Open+Sans:400,600,700,300|Oswald:400,700,300|Dosis:400,300,500,600,700|Lato:300,400,700,900', ); wp_enqueue_style('accesspress-store-google-fonts', add_query_arg($font_args, "//fonts.googleapis.com/css")); wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css'); wp_enqueue_style( 'animate', get_template_directory_uri() . '/css/animate.css'); wp_enqueue_style( 'slick', get_template_directory_uri() . '/css/slick.css'); wp_enqueue_style( 'ticker', get_template_directory_uri() . '/css/ticker-style.css'); wp_enqueue_style( 'accesspress-store-style', get_stylesheet_uri() ); wp_enqueue_style( 'accesspress-store-minify-style', get_template_directory_uri() . '/css/responsive.css'); wp_enqueue_script( 'accesspress-store-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); wp_enqueue_script( 'slick', get_template_directory_uri() . '/js/slick.js', array('jquery'), '1.5.0', true ); wp_enqueue_script( 'wow', get_template_directory_uri() . '/js/wow.min.js',array(),'1.1.2',true); wp_enqueue_script( 'ticker-script', get_template_directory_uri() . '/js/jquery.ticker.js', array('jquery'), '1.0.0', true ); wp_enqueue_script( 'skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script( 'accesspress-custom-js', get_template_directory_uri() . '/js/custom.js', array('jquery'), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'accesspress_store_scripts' ); function accesspress_ticker_header_customizer(){ //Check if ticker is enabled if(get_theme_mod('accesspress_ticker_checkbox','1') == 1){ $ticker_title = get_theme_mod('accesspress_ticker_title'); if(empty($ticker_title)){ $ticker_title="Latest"; } $ticker_text1 = get_theme_mod('accesspress_ticker_text1'); $ticker_text2 = get_theme_mod('accesspress_ticker_text2'); $ticker_text3 = get_theme_mod('accesspress_ticker_text3'); $ticker_text4 = get_theme_mod('accesspress_ticker_text4'); $ticker_array = array($ticker_text1, $ticker_text2, $ticker_text3, $ticker_text4); ?>
array($slider_post)); $query1 = new WP_Query( $args ); while ( $query1->have_posts() ) { $query1->the_post(); $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'accesspress-slider', true); ?> <?php echo esc_attr(the_title()); ?>

[ cart->get_cart_contents_count() ) ); ?> / cart->get_cart_subtotal() ); ?> ] "; echo "html body{"; if($page_background_option == 'image'): echo 'background-color:transparent !important;'; $background = get_theme_mod('background_image'); elseif($page_background_option == 'color'): echo 'background:'.esc_attr(get_theme_mod('background_color')); elseif($page_background_option == 'pattern'): echo 'background-color:transparent !important;'; echo 'background:url('.get_template_directory_uri().'/inc/images/patterns/'.esc_attr(get_theme_mod("accesspress_background_image_pattern")).'.png)'; else: echo 'background:none;'; endif; echo "}"; if($show_slider == '0'): echo '#masthead{margin-bottom:40px}'; endif; if(get_theme_mod('hide_header_cart_link')): echo ".ap-store-cart{display:none;}"; endif; echo ""; } add_action('wp_head', 'accesspress_header_scripts'); /** * Output the WooCommerce Breadcrumb */ function woocommerce_breadcrumb( $args = array() ) { $args = wp_parse_args( $args, apply_filters( 'woocommerce_breadcrumb_defaults', array( 'delimiter' => ' ', 'wrap_before' => '
', 'wrap_after' => '
', 'before' => '', 'after' => '', 'home' => _x( 'Home', 'breadcrumb', 'accesspress-store' ) ) ) ); $breadcrumbs = new WC_Breadcrumb(); if ( $args['home'] ) { $breadcrumbs->add_crumb( $args['home'], apply_filters( 'woocommerce_breadcrumb_home_url', home_url() ) ); } $args['breadcrumb'] = $breadcrumbs->generate(); wc_get_template( 'global/breadcrumb.php', $args ); } function accesspress_breadcrumbs() { global $post; $showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show $delimiter = ''; $home = __('Home', 'accesspress-store'); // text for the 'Home' link $showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb $homeLink = home_url(); if (is_home() || is_front_page()) { if ($showOnHome == 1) echo '
' . $home . '
'; } else { echo '
' . $home . ' ' . $delimiter . ' '; if (is_category()) { $thisCat = get_category(get_query_var('cat'), false); if ($thisCat->parent != 0) echo get_category_parents($thisCat->parent, TRUE, ' ' . $delimiter . ' '); echo $before . __('Archive by category','accesspress-store').' "' . single_cat_title('', false) . '"' . $after; } elseif (is_search()) { echo $before . __('Search results for','accesspress-store'). '"' . get_search_query() . '"' . $after; } elseif (is_day()) { echo '' . get_the_time('Y') . ' ' . $delimiter . ' '; echo '' . get_the_time('F') . ' ' . $delimiter . ' '; echo $before . get_the_time('d') . $after; } elseif (is_month()) { echo '' . get_the_time('Y') . ' ' . $delimiter . ' '; echo $before . get_the_time('F') . $after; } elseif (is_year()) { echo $before . get_the_time('Y') . $after; } elseif (is_single() && !is_attachment()) { if (get_post_type() != 'post') { $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; echo '' . $post_type->labels->singular_name . ''; if ($showCurrent == 1) echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after; } else { $cat = get_the_category(); $cat = $cat[0]; $cats = get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); if ($showCurrent == 0) $cats = preg_replace("#^(.+)\s$delimiter\s$#", "$1", $cats); echo $cats; if ($showCurrent == 1) echo $before . get_the_title() . $after; } } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) { $post_type = get_post_type_object(get_post_type()); echo $before . $post_type->labels->singular_name . $after; } elseif (is_attachment()) { $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); echo '' . $parent->post_title . ''; if ($showCurrent == 1) echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after; } elseif (is_page() && !$post->post_parent) { if ($showCurrent == 1) echo $before . get_the_title() . $after; } elseif (is_page() && $post->post_parent) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '' . get_the_title($page->ID) . ''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); for ($i = 0; $i < count($breadcrumbs); $i++) { echo $breadcrumbs[$i]; if ($i != count($breadcrumbs) - 1) echo ' ' . $delimiter . ' '; } if ($showCurrent == 1) echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after; } elseif (is_tag()) { echo $before . __('Posts tagged','accesspress-store').' "' . single_tag_title('', false) . '"' . $after; } elseif (is_author()) { global $author; $userdata = get_userdata($author); echo $before . __('Articles posted by ','accesspress-store'). $userdata->display_name . $after; } elseif (is_404()) { echo $before . 'Error 404' . $after; } if (get_query_var('paged')) { if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ' ('; echo __('Page', 'accesspress-store') . ' ' . get_query_var('paged'); if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ')'; } echo '
'; } } function accesspress_letter_count($content, $limit) { $striped_content = strip_tags($content); $striped_content = strip_shortcodes($striped_content); $limit_content = mb_substr($striped_content, 0 , $limit ); if($limit_content < $content){ $limit_content .= "..."; } return $limit_content; } if( is_woocommerce_activated() ){ function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0 ) { global $post; if ( has_post_thumbnail() ) { return get_the_post_thumbnail( $post->ID, $size ); } elseif ( wc_placeholder_img_src() ) { $placeholder = accesspress_woocommerce_placeholder_img_src(); $alt = get_the_title(); $placeholder_img = ''.$alt.''; return $placeholder_img; } } function accesspress_woocommerce_placeholder_img_src(){ $placeholder = ""; $custom_placeholder = get_theme_mod('custom_placeholder'); if($custom_placeholder!=''){ $placeholder = $custom_placeholder; } else{ $placeholder = wc_placeholder_img_src(); } return $placeholder; } add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 12;' ), 20 ); if (! has_filter('wc_product_sku_enabled')) { add_filter( 'wc_product_sku_enabled', '__return_true' ); } /** * Display Related Product Number */ add_filter( 'woocommerce_output_related_products_args', 'accesspress_store_related_products_args' ); function accesspress_store_related_products_args( $args ) { $args['posts_per_page'] = 3; // 3 related products return $args; } remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); add_action( 'woocommerce_after_single_product_summary', 'accesspress_store_woocommerce_output_upsells', 15 ); if ( ! function_exists( 'accesspress_store_woocommerce_output_upsells' ) ) { function accesspress_store_woocommerce_output_upsells() { woocommerce_upsell_display( 2,1 ); } } } function accesspress_store_special_nav_class($classes, $item){ if($item->title == "Cart"){ $classes[] = "ap-store-cart"; } return $classes; } add_filter('nav_menu_css_class' , 'accesspress_store_special_nav_class' , 10 , 2); remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5); function accesspress_store_before_top_header_enabled(){ if(is_user_logged_in() || get_theme_mod('accesspress_ticker_checkbox')===1){ return true; } else{ return false; } } if ( ! function_exists( 'accesspress_store_fallback_menu' ) ) { function accesspress_store_fallback_menu(){ $args = array( 'menu_class' => 'store-menu', 'echo' => true, ); wp_page_menu( $args ); } } function accesspress_store_custom_css(){ $accesspress_store_css = get_theme_mod('accesspress_store_css'); ?>