WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
is_category() appears only to apply to category view, (5 posts)

  1. rghollenbeck
    Member
    Posted 3 years ago #

    I just downloaded and installed Widget Logic, and it seems to work alright, but I need learn to master the conditional tags. I tried to change the sidebar widget depending on a particular category of posts, but for any singular post withing that category. The category was "Writing" so I put as my option in the widget,
    is_category('Writing')
    I expected all individual posts within that category to have that specific widget. But that only worked in category view.

    I was thinking I could do something like:
    is_singular(array(is_category('Writing')))
    but I really have no idea what I'm talking about.

    Any ideas? Many thanks!

  2. rghollenbeck
    Member
    Posted 3 years ago #

    Oops! I think I meant to say,

    is_single(array(is_category('Writing')))

    but I still have no idea what I'm talking about.

    This is some pretty powerful stuff, but it will take me a while to learn it.

    I sure would appreciate some help.

    I'm trying to control the widgets within all single posts from a specific category. I hope this clarifies my question.

    Thanks so much for any help offered.

  3. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    for single posts, try to use
    in_category()
    or the combination
    is_single() && in_category()

    http://codex.wordpress.org/Conditional_Tags

  4. rghollenbeck
    Member
    Posted 3 years ago #

    Thank you. I'll try that after I get WordPress up and running again after I screwed it up.

    My installation is in a subfolder with the root index.html as the home page. That was causing problems and all my links started going back to the root homepage. So I changed the site URL to the root like a dummy and crashed the WordPress installation. Now I'm trying to find the file to edit to get WP to load again.

  5. rghollenbeck
    Member
    Posted 3 years ago #

    Yes, that in_category() was EXACTLY what I was looking for! With the extensive overuse of categories, we can make really customized widgets

    Thanks so much.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic