Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1269522
    taqvi
    Participant

    Hi
    I am using icon stack but i am not able to add a sidebar in the woocommerce shop page, although sidebar is visible on all other pages including product pages. Please check the link.

    https://www.attixshoes.com/shop/

    Best Regards

    #1269542
    Paul R
    Moderator

    Hi,

    To add sidebar, you can add this in your child theme’s functions.php file.

    
    function blog_index_sidebar($contents) {
      if ( x_is_shop() ) {
        $contents = 'sidebar-content';
      }  
      return $contents;
    }
    add_filter('x_option_x_layout_content', 'blog_index_sidebar');
    

    Hope that helps.

    #1271458
    taqvi
    Participant

    Hi
    thanks for your reply, i am not using child theme can i add this to main theme funciton.php?

    Best Regards

    #1271634
    Nabeel A
    Moderator

    Hi again,

    It is not recommended to add any piece of code directly to the parent theme because all of your modifications will be overwritten when an X update is released, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Hope this helps!

    #1272636
    taqvi
    Participant

    Hi
    Thanks for your reply but I can not find child theme in the download package could you please tell me from where I can get the child theme?

    Best Regards

    #1272668
    Lely
    Moderator

    Hi There,

    On the dashboard of this forum, click child theme. You can download it from there. The link should is this:https://community.theme.co/child-theme/

    Hope this helps.

    #1273160
    taqvi
    Participant

    Hi
    Thanks for providing the download link, I have setup the child theme and insert the above mentioned code in the functions.php but now my site is broken and not showing menu and sidebar properly, Please check the following link

    Home

    #1273162
    taqvi
    Participant

    Best Regards

    #1273185
    Joao
    Moderator

    Hi There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks

    Joao

    #1273256
    taqvi
    Participant
    This reply has been marked as private.
    #1273967
    Friech
    Moderator

    Hi There,

    You need to re-set the menu to be primary again, since you switched theme. The sidebar is there its just empty, please put a widget on it under Appearance > Widgets > Main.

    Hope it helps, Cheers!

    #1274008
    taqvi
    Participant

    Hi
    Thanks, menu and sidebar sorted again but the problem which i discussed earlier is till remain, as i can not see sidebar at the shop or product pages. I have entered the above mentioned code in child/funcions.php

    Best Regards

    #1274206
    Christopher
    Moderator

    Hi there,

    Only one sidebar should be assigned to each page, I unassisgned ‘Right’ sidebar and now ‘Main’ sidebar is displaying fine on shop page.

    To add sidebar to product pages, add following code in child theme’s functions.php file :

    //Add sidebar to single product
    // =============================================================================
    
    if ( ! function_exists( 'x_get_content_layout' ) ) :
      function x_get_content_layout() {
    
        $stack          = x_get_stack();
        $content_layout = x_get_option('x_layout_content', 'content-sidebar' );
    
        if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            $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() || x_is_product() ) {
              $opt    = x_get_option( 'x_woocommerce_shop_layout_content','sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
        }
    
        return $layout;
    
      }
    endif;
    
    // Add custom sidebar to product page//
    //===================================================
    add_filter( 'ups_sidebar', 'product_sidebar', 9999 );
    
    function product_sidebar ( $default_sidebar ) {
    if ( x_is_product() ) return 'ups-sidebar-main'; //Must match the ID of your target sidebar
    return $default_sidebar;
    }
    

    Hope it helps.

    #1410940
    taqvi
    Participant

    Hi
    Sorry i think i need some more support on this issue after a long time, As i have added a new woo-commerce product category but sidebar navigation and other widgets are not showing on this particular category although they are visible on other categories pages, could you please let me know what to do to fix it?

    new category link : https://www.attixshoes.com/product-category/boots/

    #1411590
    Rad
    Moderator

    Hi there,

    What’s your login URL again? I tried logging it but it says it’s disabled.

    Thanks!

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