• So my posts are all in at least two and sometimes more categories. I want to do some things conditionally is each post based on whether it is in a particular one, regardless of whether it is in other categories as well.
    if ($cat==2) doesn’t work, because the post might be in 1 & 2, and so evaluates as false.
    Perhaps I just need some PHP syntax help for how to ask if a variable contains a particular value – as opposed to being equal to a particular value.
    I’ve also considered putting all the category values into an array and then evaluating that. But I don’t really understand arrays well enough to do this.
    Any tips?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Beel

    (@beel)

    search for threads about in_category – and click on my member link and find the “switch off” thread to which I posted.

    Thread Starter Ruby Sinreich

    (@rubyji)

    Thanks, Beel!

    Thread Starter Ruby Sinreich

    (@rubyji)

    Why didn’t I ask you sooner! ;} This did just the trick, I am just not used to all these cool 1.3 variables yet.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to tell if a post is in one of many categories’ is closed to new replies.