woocommerce sidebar on particular page
-
CreatorTopic
-
August 27, 2014 at 11:25 pm #18376
vtheme
ParticipantHI
I am aware of the settings in the Woocommerce patch, but am trying to just override all setting for a particular page and not getting the result I hoped for.
In the patch settings, I have woocommerce default for all options.
I am wanting to set full_width on one particular woocommerce page by adapting the code from:
http://support.themeblvd.com/forums/topic/woocommerce-full-width-product-page/to this:
function my_woocommerce_catalog_sidebar_layout( $sidebar_layout ){ global $post; // Only run if WooCommerce plugin is installed if( function_exists( 'is_woocommerce' ) ) { if( is_product('18013') ) { /* our-fall-catalog */ echo' 18013'; $sidebar_layout = 'full_width'; echo ' '.$sidebar_layout; } } return $sidebar_layout; } remove_filter( 'themeblvd_sidebar_layout', 'tb_woocommerce_sidebar_layout' ); add_filter ( 'themeblvd_sidebar_layout', 'my_woocommerce_catalog_sidebar_layout' );
I know that I am getting into the loop by the echo results, but the sidebar is still showing.
Do you see anything I am doing incorrectly here?
-
CreatorTopic
-
AuthorReplies
-
August 27, 2014 at 11:50 pm #18382
Jason Bobich
KeymasterIf this is in your functions.php just like that it won’t override the WooCommerce patch plugin because these filters are added within a function hooked to “after_setup_theme” — which proceeds what you’re doing.
In other words, when you do the following, you’re not actually removing anything:
remove_filter( 'themeblvd_sidebar_layout', 'tb_woocommerce_sidebar_layout' );
And then when you do this:
add_filter ( 'themeblvd_sidebar_layout', 'my_woocommerce_catalog_sidebar_layout' );
… you’re adding your filter at default priority 10, but then that’s getting overridden by the filter added by the plugin.
Try setting your filter up like this:
function my_woocommerce_catalog_sidebar_layout( $sidebar_layout ) { // ... } add_filter( 'themeblvd_sidebar_layout', 'my_woocommerce_catalog_sidebar_layout', 11 );
August 28, 2014 at 12:25 am #18384vtheme
ParticipantYep, that worked …. ahh what a second pair of eyes and a load more knowledge would bring me….
There was a loss in the color of some of the added text in my custom woo page, but that is an easy adjustment.
Thanks so very much for the help and for always giving us some background to help us understand things better!!
August 28, 2014 at 1:49 am #18385vtheme
Participantwhoops, I probably spoke too soon.
I am seeing some weird things on the custom product page that I have added.
1. I lose the color attribute for the text
2. I lose the class=”themeblvd-lightbox mfp-image” on my thumbnails on that page
3. the footer text on that page is not in the usual color
4. the text on the footer bar is missing…I suppose this has to do with timing on things… but do you see any pattern here for a fix?
September 23, 2014 at 10:24 am #18737vtheme
ParticipantDisregard the last post – I got things working now. Thanks for heading me in the right direction.
September 23, 2014 at 8:27 pm #18741Jason Bobich
KeymasterApologies I never saw that follow up post a few weeks ago. I only saw where you said it worked.
September 23, 2014 at 8:43 pm #18743vtheme
ParticipantNo problem – I always appreciate your quality themes and support.
-
AuthorReplies
- The forum ‘Akita Responsive WordPress Theme’ is closed to new topics and replies.