In wordpress, how do I know which page is current?
2 answers
You can use is_page () function. You can use page id, name or slug as argument.
Examples:
<a href="#" <?php if(is_page(42)) echo 'class="active"'?>>Page 42</a>
<a href="#" <?php if(is_page('About Us')) echo 'class="active"'?>>About Us</a>
<a href="#" <?php if(is_page('our-friends')) echo 'class="active"'?>>Our Friends</a>
+2
a source to share
using CSS you can create current WordPress page.
CSS
li.current_page_item a {
color: red;
}
this WordPress Codex page can explain the whole process better: http://codex.wordpress.org/Dynamic_Menu_Highlighting
0
a source to share