How to add Active Class on index.php
-
I am using this to give my pages an active state:
<?php if ( is_page('page1') ) { $current = 'about'; } elseif ( is_page('page2') ) { $current = 'contact'; } ?>
However, I do not know how to call the index.php page. Does anyone know how to do that? The index.php page of my site is the blog. The other pages (about, contact) are pages. In the example above, ‘page1’ and ‘page2’ are the actual titles of the pages, so I can call them directly. However, index.php is the posts page, so it does not have a title. Is there php code that calls the index.php page? Please help if you can. Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to add Active Class on index.php’ is closed to new replies.