- This topic is empty.
- The forum ‘Back End’ is closed to new topics and replies.
I imagine this is a relatively simple problem as I’ve seen the finished product many times.
So, I have my index.php file which then includes my header.php code in the relevant place,
My issue, is how do I set the class to be current-menu-item on the index.php page itself, so it can be set per page?
Are you using only an index.php and loading new content in it or do you have seperate pages for example, about.php/contact.php?
If you’re only using an index file i’d suggest using $_GET variables to add an active class to your menu.
If you’re using seperate pages you can define a variable before including your header that tells it which page it is.
After a quick google I found these examples:
I hope this helps, if not let me know!