WordPress.org

Support

Support » Plugins and Hacks » Using Widget Logic to display certain widgets on specific pages

Using Widget Logic to display certain widgets on specific pages

  • I’m very confused about what code to use to have different widgets display on specific pages. Example:
    On the About and Blog page I want the same two arbitrary text widgets and the categories widget to display but I want to omit the Meta and Blogroll widgets to NOT display on the About page.

    How do I achieve this using the Widget Logic plugin?

    Specifically looking for the code for the conditional tag because I am no expert at php yet…much obliged.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you had a quick look at http://wordpress.org/extend/plugins/widget-logic/other_notes/ ?

    One of the first example is

    !is_page(‘about’) — everywhere EXCEPT this specific WP ‘page’

    the blog page depends on how you have your blog set up. on the WL faq at http://wordpress.org/extend/plugins/widget-logic/faq/ it says

    “Another source of confusion is the difference between the Main Page and the front page.”

    linking to http://codex.wordpress.org/Conditional_Tags#The_Main_Page

    Yes, I saw this:
    !is_page(‘about’) — everywhere EXCEPT this specific WP ‘page’

    I figured it out. Actually using the !is-home tag worked!
    Yay.

    Actually, I am still have an issue with widgets I want to appear only in the ‘about’ page sidebar and not on the main blog page. I figure out how to get widgets I want to appear only on the main blog page (login, categories, links) but how do I get the reverse affect?

    I tried this code: !is_page(‘blog’)
    Because I want it ‘everywhere’ (about page) EXCEPT the BLOG PAGE.
    It didn’t work….

    Yes! My project: Display a Category listing on the blog pages but not the static pages, & not the static Home (front) page.
    Add category widget, and put in Widget Logic code space: “is_home() || is_category()” Voila!
    The trick is the blog posts page is considered “home” in WordPress. Example here.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using Widget Logic to display certain widgets on specific pages’ is closed to new replies.
Skip to toolbar