overwrite conditional function (1 post)

  1. Aysseline
    Posted 7 years ago #


    I've got code in my functions.php to add different class like this for example:

    if ( is_page('11')) { echo 'class1'; } elseif ( is_page('12')) { echo 'class2'; } elseif ( in_category('4')) { echo 'class3'; }

    and I want to overwrite class for a post in category 4. If I do this:
    elseif (in_category('4') && is_single('106')) { echo 'class4'; }

    But post 106 from category 4 keep class3, not class4 like I want. I want to know how I can tell WP to add one class for all posts in cat4 but add another class for post 106 that is in the same cat.


Topic Closed

This topic has been closed to new replies.

About this Topic