/ Published in: PHP
![](/img/icon_sav.png?v3)
Better way to echo a .current_page_item class on a list nav.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<ul><li <?php if (is_page($post->ID)) { echo'class="current_page_item"'; } ?>>Menu Item 1</li></ul>
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)