The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Menu current item selected

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #193714
    Ashley Rushworth

    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?

    Thanks, Ashley


    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:

    Example 1 using $_GET

    Example 2 using seperate pages

    I hope this helps, if not let me know!

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.