Widget Logic Help Needed

by alanaj
2 replies
  • WEB DESIGN
  • |
Hi,

I'm trying to get a widget to appear on a category archive page and each post under the category using Widget Logic, but it's not working.

These are the codes I've tried in the Widget Logic field so far:

(is_category('test') || (is_single() && in_category('test'))
(is_category('test') || is_single() && in_category('test')
both with and without the ' '

is_category('5') || (is_single() && in_category('5'))
is_category('5') || is_single() && in_category('5')
both with and without the ' '

Is there additional coding I need to add to the function.php file? I've been searching all evening but no success. Any help will be greatly appreciated.


Thanks in advance!
#logic #needed #php #widget #wordpress
  • Profile picture of the author Istvan Horvath
    The first set of code should work. The second is not good because it is written in something other than plain text editor and it has "curly" quotes instead of straight quotes.


    Did you go through the troubleshooting steps outlined in the FAQ of the plugin?
    WordPress › Widget Logic « WordPress Plugins
    Signature

    {{ DiscussionBoard.errors[3871059].message }}
  • Profile picture of the author alanaj
    Thanks Istvan! I got it now. I needed to tick the wp_reset_query option. You're the best
    {{ DiscussionBoard.errors[3871797].message }}

Trending Topics