WordPress.org

Forums

Widget Logic
Prob with showing in category and category posts (11 posts)

  1. stevecummins
    Member
    Posted 2 years ago #

    Hi,
    I'm having a problem showing a widget in a particular category and all that category's posts.

    I'm using:
    is_category('travel') || (is_single() && in_category('travel'))

    It worked fine this morning but since upgrading Widget Logic it is not.
    I reverted to 0.52 but still getting the same problem.

    Any ideas?

    http://wordpress.org/extend/plugins/widget-logic/

  2. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    looks fine. did you change anything else at the same time?

  3. stevecummins
    Member
    Posted 2 years ago #

    The new update of Logic and of wordpress was installed but after that i went back to previous version of logic after reading on this site

  4. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    as the roll back to 0.52 didn't fix it, it sounds like there is some other contributory factor.

    try going back to basics. can you make one forever vanish with 'false' and another always appear with 'true'. Does 'is_single()' work? how about 'is_category('travel')' by itself and so on.

  5. stevecummins
    Member
    Posted 2 years ago #

    Really appreciate this Alan.

    Is_single() works alone as does is_category('travel') it's when they are combined that is_single() doesn't work in any form. it works alone if you past the post name through it but not if it's written with is_category('travel')

    Has me very perplexed

  6. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    does in_category('travel') work? so that when you are on a single post that it's in that category you see it, but a single post not in that category you don't.

  7. suemm
    Member
    Posted 2 years ago #

    this is happening to me as well (this is my first time using this filter). The in_category('name') does not work.

    is_single, and is_category work. I am using the latest version of the plugin.

  8. suemm
    Member
    Posted 2 years ago #

    What I found out was the permalink settings have to be /%category%/%postname%/. Its not working with just /%postname%/

    I would like to know if there is a work around for this.

  9. suemm
    Member
    Posted 2 years ago #

    I was wrong my post above does not work for using the "in_category" condition.

  10. Xenoshane
    Member
    Posted 2 years ago #

    Hey,

    Im also having the same problem.

    I wanted a widget to appear on Page 1, Page 2, on the Entertainment Category Page, and then on each individual post with an entertainment category assigned to it.

    I have tried the following, and whereas it mostly works, it also displays the widget under another category called Sport.

    is_page("Page 1") || is_page ("Page 2") || is_category("entertainment") || is_single() && in_category('entertainment')

    Any help is very much appreciated, cant figure whats up.

  11. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    there's a note specifically about is_page in the FAQ - check that. But I don't think you are using is_page appropriately - it's for 'page' style pages, not PAGED pages. it's a poor choice of WordPress nomenclature.

    ISTR that you can find out which page of a category you are on with the global $paged variable. or it might be more complex according to this…

    http://codex.wordpress.org/Function_Reference/is_paged

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.