Tagged: x
-
AuthorPosts
-
August 31, 2016 at 12:36 am #1154581
marcooosParticipantI want to add a sidebar with a menu (listing the categorys) on the category page on Woocommerce.
Is this possible?
August 31, 2016 at 12:37 am #1154582
marcooosParticipantThis reply has been marked as private.August 31, 2016 at 2:05 am #1154652
ChristopherModeratorHi there,
To assign sidebar to archive pages, select taxonomies under Appearance -> Sidebar.
Hope it helps.
August 31, 2016 at 6:39 am #1154954
marcooosParticipantHey Christopher,
I thought it was that easy, and I’ve already done that.
But it’s not showing up 🙁
August 31, 2016 at 7:41 am #1155031
Paul RModeratorHi,
To add sidebar, kindly add the code below in your child theme’s functions.php {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() || x_is_product_category() || x_is_product_tag() ) { $layout = 'content-sidebar'; } return $layout; }Hope that helps.
September 1, 2016 at 4:12 am #1156534
marcooosParticipantHi Paul,
I have added that code but it is not working still 🙁
September 1, 2016 at 4:39 am #1156575
RadModeratorHi there,
Please add the provided code to your child theme’s functions.php and not at style.css
Thanks!
September 1, 2016 at 6:25 am #1156683
marcooosParticipantYep, thats what I did. My login details are up top, you can log in and see for yourself.
September 1, 2016 at 6:47 am #1156716
Paul RModeratorHi,
Upon checking, I can see you have added it in style.css and not in functions.php file.
Please see screenshot – http://screencast.com/t/pW1bHPtz
September 1, 2016 at 10:58 pm #1157956
marcooosParticipant1000 apologies! Its is working now.
BUT now the default sidebar also shows on the shop index page, even though I have “enable sidebar on shop index page” unchecked.
How do I fix this?
September 2, 2016 at 12:13 am #1158021
LelyModeratorHi There,
If you don’t want the sidebar to show on the shop index page, please check the following part of the code suggested by Paul :
if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) { $layout = 'content-sidebar'; }Update to this:
if (x_is_product_category() || x_is_product_tag() ) { $layout = 'content-sidebar'; }Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1154581 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
