Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1233146
    s_mocko
    Participant

    Hi

    I am having the sidebar show on some product category pages and not others. have it set to global conetent layout

    See here http://eurekawellness.com.au/product-category/detox/

    compared to

    http://eurekawellness.com.au/product-category/view-all/

    I want side bar on all product category pages but can not figure it out.

    Thanks for the Help

    #1233150
    s_mocko
    Participant
    This reply has been marked as private.
    #1233152
    s_mocko
    Participant
    This reply has been marked as private.
    #1233305
    Lely
    Moderator

    Hi There,

    Thank you for the credentials.

    Upon checking sidebar is showing as expected here:http://eurekawellness.com.au/product-category/view-all/
    Then on this one: http://eurekawellness.com.au/product-category/detox/ it is not showing anymore but the sidebar space is still there. If you want to remove it and make it fullwidth instead, please add the following on Appearance > Customize > Custom > Edit Global CSS:

    .term-detox .x-main {
        width: 100%;
    }

    Hope this helps.

    #1233898
    s_mocko
    Participant

    I want the sidebar on all shop pages and category pages.

    #1234324
    Rad
    Moderator

    Hi there,

    Please add this code to your child theme’s functions.php

    function x_get_content_layout() {
    
        $content_layout = x_get_option( 'x_layout_content' );
    
        if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
          } elseif ( x_is_portfolio_item() ) {
            $layout = 'full-width';
          } elseif ( x_is_portfolio() ) {
            $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
            $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
          } elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
            $layout = 'content-sidebar';
          } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
            $layout = 'sidebar-content';
          } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
            $layout = 'full-width';
          } elseif ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
              $opt    = x_get_option( 'x_woocommerce_shop_layout_content' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            } else {
              $opt    = x_get_option( 'x_archive_layout' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( x_is_product() ) {
            $layout = 'full-width';
          } elseif ( x_is_bbpress() ) {
            $opt    = x_get_option( 'x_bbpress_layout_content' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
        }
    
    		 if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
    		          $layout = 'content-sidebar';
    		 }
    
        return $layout;
    
      }

    Then assign your sidebar, but if you wish to force-display specific sidebar, then add this as well

    add_filter( 'ups_sidebar', 'ups_display_shop_sidebar', 99999 );
    
    function ups_display_shop_sidebar ( $sidebar ) {
    
    return x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ? 'YOUR_SIDEBAR_ID_HERE' : $sidebar;
    
    }

    Replace YOUR_SIDEBAR_ID_HERE with the ID of your sidebar created at Admin > Appearance > Sidebars

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1233146 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>