Display widget only on single posts, not single product page
-
I added my own widgets to display on blog pages/posts only, and not the front page or pages in general.
I have woocommerce installed and because ‘is_single’ applies to single product pages, too, it is displaying there when I don’t want it to.
I’m not great at php and I could google until I turn blue and waste hours trying to figure this out, I’m hoping posting in here will get a faster response than doing the above.
I’m also using Genesis. Here is the code for the widget:
add_action( 'genesis_before_footer', 'my_footer_widget2' ); function my_footer_widget2() { if ( is_home() || is_single()) genesis_widget_area ('my_footer_widget2', array( 'before' => '<div class="footer_widget2">', 'after' => '</div>', ) ); }
There are a total of three widgets that I need to fix so they display on single post pages, but NOT single product pages. This is in a custom_functions php file that is called by the main functions file for the theme I’m using.
I tried using “not_is_product” after is_single, but that did not have any effect.
Thanks in advance.
- The topic ‘Display widget only on single posts, not single product page’ is closed to new replies.