Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #990374
    alexdigital
    Participant

    Hi,

    How can i add a sidebar to the shop pages when the global site setting if full width?

    Thanks in advance.

    -Alex

    #990786
    Prasant Rai
    Moderator

    Hello Alex,

    Thanks for writing in!

    Please follow the instructions to display sidebar in shop page:

    1) Open your shop page and assign Content Left and Sidebar Right template. (You can choose any template as per requirement.)

    http://prntscr.com/b3tguj

    2) Next navigate to Appearance > Sidebar and create a new sidebar. After that open the newly created sidebar and click on Enable sidebar on shop index page. Click on Update Sidebar button.

    http://prntscr.com/b3thg5

    3) Go to Appearance > Widget and place required widgets in newly created sidebar.

    http://prntscr.com/b3thxy

    Let us know how it goes.

    Thanks.

    #996095
    alexdigital
    Participant
    This reply has been marked as private.
    #996593
    Darshana
    Moderator

    Hi there,

    It seems like you have forgotten to include your site URL. Once we have that, we will check into your issue.

    Thanks!

    #997585
    alexdigital
    Participant

    Sorry!

    It’s http://graphicvision.co.uk/

    -Alex

    #998058
    Jade
    Moderator

    Hi Alex,

    Thanks for the link.

    It can be achieved by template change, to do so, follow these instructions:

    Step 1: Copy the file wp-content/themes/x/framework/views/integrity/wp-sidebar.php in your child theme’s folder /framework/views/integrity/, open it in a text editor and replace the following line of code (probably line # 11):

    <?php if ( x_get_content_layout() != 'full-width' ) : ?>
    

    Width following:

    <?php if ( x_get_content_layout() != 'full-width' || ( is_shop() || is_product_category() || is_product_tag() ) ) : ?>
    

    Step 2: Add following code in your child theme’s functions.php file:

    // Main Content Class
    // =============================================================================
    
    if ( ! function_exists( 'x_main_content_class' ) ) :
      function x_main_content_class() {
    
        switch ( x_get_content_layout() ) {
          case 'content-sidebar' :
            $output = 'x-main left';
            break;
          case 'sidebar-content' :
            $output = 'x-main right';
            break;
          case 'full-width' :
            $output = 'x-main full';
            break;
        }
    
        if ( is_shop() || is_product_category() || is_product_tag() ) {
          $output = 'x-main left';
        }
    
        echo $output;
    
      }
      add_action( 'customize_save', 'x_main_content_class' );
    endif;
    
    // Sidebar Class
    // =============================================================================
    
    if ( ! function_exists( 'x_sidebar_class' ) ) :
      function x_sidebar_class() {
    
        switch ( x_get_content_layout() ) {
          case 'content-sidebar' :
            $output = 'x-sidebar right';
            break;
          case 'sidebar-content' :
            $output = 'x-sidebar left';
            break;
          default :
            $output = 'x-sidebar right';
        }
    
        if ( is_shop() || is_product_category() || is_product_tag() ) {
          $output = 'x-sidebar right';
        }
    
        echo $output;
    
      }
      add_action( 'customize_save', 'x_sidebar_class' );
    endif;
    

    Step 3: That’s it!

    Now, no matter which layout you choose in the Customizer, the sidebar will always be visible on Shop index, category and tag archive pages (Content Left, Sidebar Right).

    If you are still having troubles on making this work kindly provide us with your FTP details.

    Thank you.

    #1018910
    alexdigital
    Participant

    Thanks!

    Worked a treat.

    -Alex

    #1018941
    alexdigital
    Participant

    Hi,

    I’ve just noticed it’s ok on the shop page, but not categories.

    Any ideas?

    -Alex

    #1018969
    John Ezra
    Member

    You’re most welcome!

    #1019567
    alexdigital
    Participant

    did you see my other comment?

    #1019583
    Christopher
    Moderator

    Hi there,

    Sidebar is displaying in archive page too.

    You just need to check the boxes for taxonomies under Appearance -> Sidebar -> custom sidebar.

    Thanks.

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