/ Published in: PHP
                    
                                        
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
 Subscribe to comments
                    Subscribe to comments
                
                