Tagged: x
-
AuthorPosts
-
October 10, 2016 at 1:59 am #1209462
AVENGERParticipantHello! I really love this theme so far, you guys did a really good job!
I have a question and hope you can help me with my issue…
I am using Integrity 1 for my site.
I would like my shop page to be fullwidth to list only the products, with no sidebar. However, I would like the Single Product view to have a sidebar, and for each product I would like to have different content. How can I do this in the most effective and efficient way?
I hope you can assist me with this, thank you! 🙂
Best regards!
October 10, 2016 at 2:53 am #1209520
Paul RModeratorHi,
To achieve that, you can add this in your child theme’s function.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 = 'full-width'; } if ( x_is_product() ) { $layout = 'content-sidebar'; } return $layout; }https://community.theme.co/kb/unlimited-sidebars/
Hope that helps.
October 11, 2016 at 12:12 am #1210921
AVENGERParticipantThank you for your response.
I have added the code to my child’s function.php I can now see a placeholder for the sidebar on each of my single product pages but now I don’t know how to add specific sidebar to a specific product?
What I would like to achieve:
I would like to have different sidebar-content on each of the different product pages.
This is what I did:
I went to Sidebars, and created a new sidebar which is supposed to be only on 1 of the product pages. I only specified the name for the sidebar, and on the left side where it shows All Pages and Posts, I did not see my product. So I didn’t select anything there. I moved down to All Taxonomies, and I’ve selected the tag that shows only on that 1 product page. I thought, this will make it work, but the sidebar isn’t showing.
How should I proceed?
October 11, 2016 at 3:09 am #1211090
Paul RModeratorHi,
Regretfully what you trying to achieve could only be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding. Take care!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1209462 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
