Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1238753
    powrider686
    Participant

    Hello,
    On my site, roadsidegal.wpengine.com, I can’t seem to get the sidebar to display on the shop page – http://roadsidegal.wpengine.com/shop/.

    I have created a sidebar, set the shop page to “sidebar left, content right”, enabled all the, I think, correct settings in the sidebar, namely Use Global Content Layout as per the instructions within customizer, and have widgets in the sidebar I created and I still can’t get it to display.

    Can you take a look and help?

    I appreciate it!

    Marcus

    #1238754
    powrider686
    Participant
    This reply has been marked as private.
    #1238863
    Paul R
    Moderator

    Hi Marcus,

    To add sidebar to your shop page.

    You can add this in your child theme’s functions.php file(wp-content/themes/x-child/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() ){
                $layout = 'sidebar-content';         
         }
        return $layout;
    
      }
    

    Hope that helps.

    #1239651
    powrider686
    Participant

    That did – kind of.

    I attached a screenshot of it but it basically just pushes everything else to the right. Can it be added within the content page? It doesn’t look good at all like this and seems to cut off the right side of the shop as well.

    #1240284
    Paul R
    Moderator

    Hi,

    That is the default design of Ethos Stack as you can see in our demo.

    http://demo.theme.co/shop-ethos/

    To make it look like it is inside the content page, you can add this in custom > edit Global CSS in the customizer.

    
    .x-container.main:before {
        background-color:transparent;
    }
    
    .x-header-landmark+.x-container>.offset>.x-sidebar {
         margin-top: 0px;
    }
    
    .x-container>.offset {
        background-color:#fff;
    }
    

    Hope that helps

    #1241091
    powrider686
    Participant

    Ok got it.

    I’m going to go with the first option, but how can we get rid of the large blank space on the left?

    The way it looks here – http://demo.theme.co/shop-ethos/ – looks great. How can I achieve that?

    Thanks for the help!

    #1241368
    Lely
    Moderator

    Hello There,

    Please add the code suggested so we can check the difference in structure from your site and ethos demo.

    #1241720
    powrider686
    Participant

    I think it’s all good. My view was zoomed out 50% 😉

    But how would I change that to be content left, sidebar right? The page template setting doesn’t seem to have any effect.

    Also, just curious, but why does having the sidebar for the store require editing the child theme? Is it not available as a default layout for some reason?

    Thanks for the help!

    #1241722
    powrider686
    Participant

    Another question: When you choose a category from the product categories on the left, it takes you to a page which the header is “Category Archive” instead of the category. Is it possible to have the category chosen display here? It implies that these products are archived instead of looking at the …automotive… or whatever category.

    Thanks for the help!

    #1241962
    Paul R
    Moderator

    Hi,

    1. Please note that once you have selected full width to be your layout in the customizer it will override the page template you have selected under page attribute. So the only way to add sidebar to your shop with full width active is to add a custom code in your child theme’s functions.php

    To change it to content left – sidebar right, kindly change the code provided in #1238863 with this

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

    2. Category Archive is the default title but you can to add your own.

    Please see screenshot – http://screencast.com/t/iK56hXYNP72k

    Thanks

    #1248222
    powrider686
    Participant

    Great, thanks for the help! Appreciate it!

    Marcus

    #1248316
    Lely
    Moderator

    You’re welcome Marcus!

    Cheers!

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