Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #909629
    BeardedRick
    Participant

    Hey there, thanks for the reply.

    I’ve tried that snippet and it works, CSS as well. However there are two main issues:

    1. I had to find a workaround for the right sidebar to show because replacing the code didn’t work so I populated the main widget with the shop sidebar’s content. Could this potentially be a problem when I need to use the main sidebar for blog posts, etc.?

    2. The sidebar is still showing on the product page: http://mikrosjewels.com/mikros-shop/product/veronique/
    This is the code as per your instructions:

    
    
    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() ) {
      $layout = 'content-sidebar';
    } else {
      $layout = 'full-width';
    }
        }
    
        return $layout;
    
      }

    I left $layout = 'content-sidebar'; because my custom one didn’t work.

    Any suggestions?

    Thank you

    #910203
    Christopher
    Moderator

    Hi there,

    Please navigate to Customize -> Layout and design and select one of page layouts with sidebar, next naviagate to woocommerce section in customizer and and select ‘Global content layout’, see the attachment.

    Hope it helps.

    #978844
    BeardedRick
    Participant

    Hi @Christopher,

    It still shows the sidebar on single product: http://mikrosjewels.com/mikros-shop/product/clutchjanem/

    Any ideas?

    #979660
    Rue Nel
    Moderator

    Hello There,

    Please update your wp-sidebar.php in your child theme. It should be like this:

    <?php
    
    // =============================================================================
    // VIEWS/ICON/WP-SIDEBAR.PHP
    // -----------------------------------------------------------------------------
    // Sidebar output for Icon.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_content_layout() != 'full-width' || x_is_shop() ) : ?>
    
      <aside class="x-sidebar nano" role="complementary">
        <div class="max width nano-content">
          <?php if ( get_option( 'ups_sidebars' ) != array() ) : ?>
            <?php dynamic_sidebar( apply_filters( 'ups_sidebar', 'sidebar-main' ) ); ?>
          <?php else : ?>
            <?php dynamic_sidebar( 'sidebar-main' ); ?>
          <?php endif; ?>
        </div>
      </aside>
    
    <?php endif; ?>

    The code above will only display the sidebar on the shop page.

    #983992
    BeardedRick
    Participant

    Guys it’s great getting help from all of you and it’s much appreciated but it’s getting a little confusing.

    I was told to remove the wp-sidebar.php a few posts ago and now to put it back on. Either way the sidebar still appears on the single product page.

    How can I remove the sidebar from the single product page?

    #984238
    Thai
    Moderator

    Hi There,

    Please add the following CSS under Customizer > Custom > Global CSS:

    .single-product .x-sidebar.nano {
        display: none;
    }

    Hope it helps 🙂

    #984239
    Thai
    Moderator

    Hi There,

    Please add the following CSS under Customizer > Custom > Global CSS:

    .single-product .x-sidebar.nano {
        display: none;
    }

    Hope it helps 🙂

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