Title: Problem with conditional tags
Last modified: August 19, 2016

---

# Problem with conditional tags

 *  [stroppy](https://wordpress.org/support/users/stroppy/)
 * (@stroppy)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/problem-with-conditional-tags-1/)
 * Hello
 * I am using the following conditional tags to output a current class for a ‘News’
   tab in my websites’ menu:
 *     ```
       <li<?php if ( have_posts() ) { the_post(); rewind_posts(); }
       if ( is_home('') || is_page('') || is_category('3') || is_category('266') || is_category('267') || is_category('278') || is_category('316') || is_category('317') || is_category('318') || is_category('319') || is_category('448') || is_category('449') || is_category('507') || in_category('3') || in_category('266') || in_category('267') || in_category('278') || in_category('316') || in_category('317') || in_category('318') || in_category('319') || in_category('448') || in_category('449') || in_category('507') ) { } else { echo ' class="current"'; } ?>><a href="http://www.mysite.com/news">News</a></li>
       ```
   
 * The code is meant to output nothing for the categories specified, as well as 
   my site’s homepage and static pages. Otherwise, it should add the current class
   to the `<li>` tag.
 * However, when viewing a certain category (with an ID of 449), the code doesn’t
   work, meaning the tab doesn’t highlight.
 * I have tried adding an elseif statement to the code, however that didn’t work.
 * I have looked thoroughly throughout my template but cannot find any code which
   conflicts with it.
 * Can anyone help me with my problem?

The topic ‘Problem with conditional tags’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [conditional tags](https://wordpress.org/support/topic-tag/conditional-tags/)
 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [output](https://wordpress.org/support/topic-tag/output/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [tab](https://wordpress.org/support/topic-tag/tab/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [stroppy](https://wordpress.org/support/users/stroppy/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/problem-with-conditional-tags-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
