WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Widget Logic] excluding home page

[Plugin: Widget Logic] excluding home page

  • Oazar
    Participant

    @oazar

    Hello

    I am using this widget on a website to display a widget in some categories and it works fine.
    I just have a problem with the homepage : the widget appears on the homepage if a post of the category where it is supposed to appear, has just been published, as the post is then on the homepage.

    I don’t want the widget to appear on home page, never, whatever posts are displayed on homepage. may you help me ?

    Thanks

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author alanft
    Member

    @alanft

    This is from http://wordpress.org/extend/plugins/widget-logic/faq/ “Widgets appear when they shouldn’t”

    your logic for the widget that is appearing when it shouldn’t probably has something like in_category(x) and it needs to be is_single() && in_category(x)

    Oazar
    Participant

    @oazar

    All right, I tried to do things like that. But what I need is the widget to appear if I am in the category page as well as on a post page.
    So I must be very clumsy, but I cannot find the good way to write it.

    what I iould need is a way to say : “never on homepage”… it doesn’t exist ?

    Plugin Author alanft
    Member

    @alanft

    Check http://wordpress.org/extend/plugins/widget-logic/faq/ “How do I get a widget to appear both on a category page and on single posts within that category?”

    Oazar
    Participant

    @oazar

    Thanks for your help, but I already have the widget appearing both in category AND post.
    I just want to prevent it displaying on home page.

    Plugin Author alanft
    Member

    @alanft

    what’s the logic you are using?

    Oazar
    Participant

    @oazar

    This is what I wrote, which is efficient. The widget appears when it should.

    My only problem concerns the homepage : I need a way to prevent the widget to dispolay on the homepage, whatever posts are displayed on this page.

    in_category(‘Prochainement’)||is_category(‘Cinéma’)||in_category(‘Cinéma’)||is_category(‘Prochainement’)||in_category(‘Spectacles’)||is_category(‘Spectacles’)||in_category(‘Espace Jean Vilar’)||is_category(‘Espace Jean Vilar’) || in_category(‘Galerie Julio Gonzalez’) || is_category(‘Galerie Julio Gonzalez’) || is_category(‘Université Populaire d\’Arcueil’) || in_category(‘Université Populaire d\’Arcueil’)||in_category(‘Médiathèque’)||is_category(‘Médiathèque’)||in_category(‘Pratiquer’)||is_category(‘Pratiquer’)||in_category(‘Artistes’)||is_category(‘Artistes’)

    Plugin Author alanft
    Member

    @alanft

    all of the instances of in_category(…) need to be (is_single() && in_category(…))

    Oazar
    Participant

    @oazar

    All right !

    thanks so much alanft, I’ll try this !

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Widget Logic] excluding home page’ is closed to new replies.