/**
  * Retrieve the standard sidebar setted for the current page, including woocommerce pages
  * 
  * @return string
  * @since 1.0.0
  */
 function yit_get_standard_shop_sidebar()
 {
     $page = '';
     if (!is_woocommerce() && !is_internal() && !is_product_attribute()) {
         if (yit_get_option('enable-all-sidebar') == 1) {
             $page = 'all';
         } else {
             if (is_posts_page() || is_single() && get_post_type() == 'post' || is_page_template('blog.php')) {
                 $page = 'blog';
             } elseif (is_404()) {
                 $page = '404';
             } elseif (is_category()) {
                 $page = 'categories';
             } elseif (is_search()) {
                 $page = 'search';
             } elseif (is_archive()) {
                 $page = 'archives';
             } elseif (is_page()) {
                 $page = 'pages';
             }
         }
     } else {
         if (yit_get_option('enable-all-custom-sidebar') == 1) {
             $page = 'all-custom';
         } else {
             if (is_product()) {
                 $page = 'single-shop';
             } elseif (function_exists('is_woocommerce') && (is_woocommerce() || is_product_attribute())) {
                 $page = 'shop';
             } elseif (is_portfolio()) {
                 $page = 'portfolios';
             } elseif (is_gallery()) {
                 $page = 'galleries';
             } elseif (is_services()) {
                 $page = 'services';
             } elseif (is_testimonial()) {
                 $page = 'testimonial';
             }
         }
     }
     return $page;
 }
Exemple #2
0
 /**
  * Retrieve the post id
  * 
  * @return integer
  * @since 1.0.0
  */
 function yit_post_id()
 {
     global $post;
     $post_id = 0;
     if (is_posts_page()) {
         $post_id = get_option('page_for_posts');
     } elseif (is_shop_installed() && (is_shop() || is_product_category() || is_product_tag() || is_product_attribute())) {
         $post_id = woocommerce_get_page_id('shop');
     } elseif (isset($post->ID)) {
         $post_id = $post->ID;
     }
     return $post_id;
 }
Exemple #3
0
<?php

/**
 * Your Inspiration Themes
 * 
 * @package WordPress
 * @subpackage Your Inspiration Themes
 * @author Your Inspiration Themes Team <*****@*****.**>
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
if (is_product_attribute()) {
    yit_add_body_class('woocommerce');
    yith_wc_get_template('archive-product.php');
    die;
}
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$blog_type = yit_get_option('blog-type');
get_header();
if ($blog_type == 'pinterest' && (is_home() || is_category() || is_tag())) {
    wp_enqueue_script('yit-jquery-masonry');
}
do_action('yit_before_primary');
?>
<!-- START PRIMARY -->
<div id="primary" class="<?php 
yit_sidebar_layout();
?>