how do I use the "category ID" variable in a conditional? (2 posts)

  1. poopers
    Posted 9 years ago #

    I'm looking to put a conditional argument on my index.php that'd look something like this:

    if $categoryid = 1 {
    echo post template #1;
    if $categoryid = 2 {
    echo post template #2;

    et cetera. My problem is: I don't know what the variable for category id is. I've tried many different variable names; perhaps I simply don't know how to globalize it. I've been trying things like $variable and $post['variable'] and nothing will parse. Any insight into this matter will be greatly appreciated.

  2. MichaelH
    Posted 9 years ago #

    You mean something like in_category?

    Also see:

Topic Closed

This topic has been closed to new replies.

About this Topic