• Hi,

    I’m trying to combine some conditional tags and can’t figure out why this particular combination isn’t working for the second half (it works for the tags part but not the single posts in categories). This is what I have:

    if( is_tag( array(10743, 10746, 10737, 10739, 10741, 10744, 10740, 10742, 10745)) || (is_single() && in_category( array( 115,181,460 ) )) )

    Any help would be great.
    Thanks,
    Luke

Viewing 5 replies - 1 through 5 (of 5 total)
  • Where is this code being used? It is possible that the $post object is not available. Perhaps declaring $post global before your test will help.

    Thread Starter webchomp

    (@webchomp)

    Hi,

    I’m using it in widget logic.

    It works if I use it by itself but not if combing it.

    Am I missing a bracket in the code or something?

    Thanks

    Try using this:

    global $post;
    if( is_tag( array(10743, 10746, 10737, 10739, 10741, 10744, 10740, 10742, 10745)) || (is_single() && in_category( array( 115,181,460 ) )) )
    Thread Starter webchomp

    (@webchomp)

    Thanks, but no that didn’t work either.

    Try removing the ‘if’.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Combining Conditional Tags’ is closed to new replies.