WordPress.org

Forums

Widget Logic
Single Page Logic Not Working (6 posts)

  1. RUBYHAUS
    Member
    Posted 2 years ago #

    So this works great for Main category, however it's not displaying the widget on single categories or single post category pages.

    Here is what I'm using.

    is_category('14') || (is_single() && in_category('14'))

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

  2. RUBYHAUS
    Member
    Posted 2 years ago #

    Also I'm using Special Recent Posts Free Edition and AVH Extended Categories.

    Special Recent Posts works on all pages (seems correct)

    But AVH Extended does not show up on the individual category pages just the All Category Page.

    http://rubyhaus.com/category/inspiration/

    once you chose an article you'll see the categories on right sidebar disappear.

    But then if you click on an actual category name now you're under a new URL and no Sidebar Widgets show up at all.

    http://rubyhaus.com/category/mobile-app-design/

  3. RUBYHAUS
    Member
    Posted 2 years ago #

    I guess really the issue is... can you do multiple Categories suchas:

    is_category('6,7,14') || (is_single() && in_category('6,7,14'))

    doesn't seem easy to allow this. Just disappears when I try to.

  4. RUBYHAUS
    Member
    Posted 2 years ago #

    Ok so I resolved when you're on "New" category page where it shows on that categories posts using:

    is_category( array( '6', '7', '14' ) ) || (is_single( array( '6', '7', '14' ) ) && is_category( array( '6', '7', '14' ) ) )

    But still NO single page widgets are visible.

    I thought is_single would be the answer but not likely so it seems.

  5. RUBYHAUS
    Member
    Posted 2 years ago #

    oops here is the correct code.

    is_category( array( '6', '7', '14' ) ) || (is_single( array( '6', '7', '14' ) ) && in_category( array( '6', '7', '14' ) ) )

  6. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    try without the parameters for is_single…

    is_category( array( '6', '7', '14' ) ) || (is_single() && in_category( array( '6', '7', '14' ) ) )

    is_single can be given an array as paremeters, but…
    http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page

    it's to match the ID of the post

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic