Title: Include php-based conditional menu in post?
Last modified: August 31, 2016

---

# Include php-based conditional menu in post?

 *  [gulliver](https://wordpress.org/support/users/gulliver/)
 * (@gulliver)
 * [10 years ago](https://wordpress.org/support/topic/include-php-based-conditional-menu-in-post/)
 * I have a conditional menu which I normally use in template files but no longer
   can since switching too ajax-loading for pages.
 * I’m wondering if there’s a way it can be added to posts/pages instead.
 * (In the code below, actual links have been replaced with #.)
 *     ```
       <ul class="tabs">
       <li<?php if (is_page('mon')) { echo " class=\"current\""; }?>><a href="#">Mon</a></li>
       <li<?php if (is_page('tue')) { echo " class=\"current\""; }?>><a href="#">Tue</a></li>
       <li<?php if (is_page(wed)) { echo " class=\"current\""; }?>><a href="#">Wed</a></li>
       <li<?php if (is_page(thu)) { echo " class=\"current\""; }?>><a href="#">Thu</a></li>
       <li<?php if (is_page(fri)) { echo " class=\"current\""; }?>><a href="#">Fri</a></li>
       <li<?php if (is_page(sat)) { echo " class=\"current\""; }?>><a href="#">Sat</a></li>
       <li<?php if (is_page(sun)) { echo " class=\"current\""; }?>><a href="#">Sun</a></li>
       </ul>
       ```
   

The topic ‘Include php-based conditional menu in post?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [gulliver](https://wordpress.org/support/users/gulliver/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/include-php-based-conditional-menu-in-post/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
