conditional tags in sidebar
-
I am trying to put a conditional tag in my side bar. So when a user is on our “cruise line” page there is a sublist of ships. Above this list it says the word “ships” only if on a specific template that will be applied to the cruise line pages..
<ul> <?php if (is_page_template('cruise-line.php')) { // on a cruise line page then spit out extra title $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1'); echo $children; } else { $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1'); echo $children; } ?> </ul>
Is the code I’m trying to use and modify. The top one I want it to add a title ‘ships’ above the list.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘conditional tags in sidebar’ is closed to new replies.