Display title of selected subpage on top of drop down menu (wordpress)

I have a drop down menu on a page that I’m building for a client (using WordPress). The title of the drop down is “Menu” and it doesn’t link anywhere, it just displays the drop down menu-items on hover.

When you select a subpage, is there a way to display the title of the active page where it says “Menu” on the startpage? For example, on Page 1 it would say Page 1 instead of Menu.

I have looked around for options, but haven’t found anything satisfying so far.

The code for the menu:

<nav class="x-nav-wrap desktop" role="navigation">
    <ul id="menu-primary-menu" class="x-nav">
        <li id="menu-item-36" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children menu-item-36"> <a href="#">
    <span>MENU</span></a>

            <ul class="sub-menu">
                <li id="menu-item-42" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-37 current_page_item menu-item-42"> <a href="http://test.frankochrakel.se/?page_id=37"><span>Page 1</span></a>
                </li>
                <li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-41"> <a href="http://test.frankochrakel.se/?page_id=39"><span>Page 2</span></a>
                </li>
            </ul>
        </li>
    </ul>
</nav>

http://test.frankochrakel.se/

I’m grateful for any ideas on how to solve this.


Source: wordpress

Leave a Reply