Support » Plugins » Conditional Statement for a Specific Category post

  • Resolved Ryan Fitzer

    (@ryanfitzer)


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional Statement for a Specific Category post’ is closed to new replies.