- This topic has 3 replies, 3 voices, and was last updated 7 years, 3 months ago by .
- The forum ‘General Discussion’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I have a site I am developing based on Genesis Sample theme.
I have a primary sidebar set up on main pages but I want to remove this sidebar on product pages and cateory-product pages.
I am using Woocommerce, Geneisis Connect for Woocommerce and YITH Woocommerce catalog mode plugins
You will see I have the products displaying full width as I have amended functions.php withn this code
//* Display 24 products per page. Goes in functions.php
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );
and the sidebar drops down below. and to the side of this section.
You need to change the setting for the category to display full-width. You can either do this one at a time by selecting the full width option on each individual page or add the following to functions.php (http://my.studiopress.com/snippets/admin-management/#force-layout-settings):
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
You would need to wrap this code in a conditional so only the category pages are changed. https://codex.wordpress.org/Conditional_Tags
I have taken the easiest way and changing the page layout for each category page rather than coding the functions.php page.
This doesn't appear to work. The page I have amended still displays the Primary sidebar and drops it down the page.
Not sure I am confident enough with coding the functions.php with conditional tags. I am assuming that both these do the same thing anyway or is this likely to work if I add the relevant code?
© 2024 WPEngine, Inc.