/**
  * Retrieve the standard sidebar setted for the current page, excluding woocommerce pages.
  * 
  * @return string
  * @since 1.0.0
  */
 function yit_get_standard_corporate_sidebar()
 {
     $page = '';
     if (!is_internal()) {
         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_portfolio()) {
                 $page = 'portfolios';
             } elseif (is_gallery()) {
                 $page = 'galleries';
             } elseif (is_services()) {
                 $page = 'services';
             } elseif (is_testimonial()) {
                 $page = 'testimonial';
             }
         }
     }
     return $page;
 }
Esempio n. 2
0
 /**
  * Check if is portfolio, testimonial or gallery.
  * 
  * @return bool
  * @since 1.0.0
  */
 function is_internal()
 {
     global $post;
     if (!isset($post) || !is_object($post)) {
         return false;
     }
     return is_portfolio() || is_gallery() || is_testimonial() || is_services();
 }