WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Conditional Statement for a Specific Category post (3 posts)

  1. Ryan Fitzer
    Member
    Posted 8 years ago #

    I've read the conditional statements page in the codex but couldn't find what I'm looking for. I want to display a specific sidebar when viewing a single post in a specific category. Something like

    if_post(cat=1);
    include(TEMPLATEPATH.'/sidebar-exhibitions.php');
    elseif_post (cat=2)
    include(TEMPLATEPATH.'/sidebar-news.php');

    kinda deal that I can stick into my single.php. Any ideas?

  2. moshu
    Member
    Posted 8 years ago #

  3. Ryan Fitzer
    Member
    Posted 8 years ago #

    Thanks so much! That was what I needed.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.