• c.devlin

    (@cdevlinalaasnau)


    I have inherited a wordpress website, which has been highly customised. This is very frustrating, particularly when you want to change things. Anyway, the main navigation menu has not been created in the menu area so I can’t add sub-pages. The main menu has been coded into the header.php and sub-pages are shown in a separate menu which has been coded into the sidebar.php. For example, when you click on ‘About us’ the sub-ages aren’t shown at the top – they are shown in the sidebar in a green widget. This is not working for us. I want the sub-pages to appear in the main menu when you hover over it.

    https://ala.asn.au/about-us/

    Can anyone help me? I have an adequate skill level – not advanced.

    Catherine

Viewing 15 replies - 1 through 15 (of 23 total)
  • Without looking at exactly how the theme coded is hard for us help you is this a wordpress theme.

    Thread Starter c.devlin

    (@cdevlinalaasnau)

    Here is the header.php

    [Please use a pastebin for large amounts of code
    https://codex.www.ads-software.com/Forum_Welcome#Posting_Code ; and always use the code buttons here ]

    @c[email protected] You will need paste the code in https://wordpress.pastebin.com and paste the url here

    Thread Starter c.devlin

    (@cdevlinalaasnau)

    Sorry being such a novice. This is the sidebar.php:

    https://pastebin.com/cTyB8jQw

    This is the header.php:

    https://pastebin.com/EhKP8DsX

    I have looked at the code and yes the menus have been hard coded and for you make theme so that you have custom menus you will need register the menu in functions.php file and then call the menu in div that has the hard coded menu.

    You will have to make changes in style.css as well for your menus.

    Thread Starter c.devlin

    (@cdevlinalaasnau)

    ?? – sorry

    We could check if your theme supports custom menus in admin panel Click on Appearance>>>>>Menus and try and create custom menu and see if you have box on left with Primary menu

    It looks like you’ll need to add the menu functionality if it’s not in that theme –

    https://codex.www.ads-software.com/Navigation_Menus

    Thread Starter c.devlin

    (@cdevlinalaasnau)

    It does have the menu functionality. A custom menu has been created for members of our organisation – this menu also sits in a widget on the home page after members log in.

    Thread Starter c.devlin

    (@cdevlinalaasnau)

    In the menu area under, theme locations, it says:

    Your theme supports 1 menu. Select which menu you would like to use.

    As previously mentioned, another custom menu sits in this area and it resides in a sidebar widget for members only

    How many menu location it have as each menu has to have a location.

    sorry cross posting

    What do you have in that one location you have.

    Thread Starter c.devlin

    (@cdevlinalaasnau)

    Nothing has been selected for the theme location.

    So you have one menu created for members and that shows on side bar when they log in if so looks like using custom menu widget for that.

    In that location box what does it say primary or something else.

    Thread Starter c.devlin

    (@cdevlinalaasnau)

    it says primary navigation:

    Your theme supports 1 menu. Select which menu you would like to use.

    Ok we getting some where now You can create another menu and add your pages to that menu and arrange them as you wish like submenus by dragging them right under parent. once have whole menu set save the menu

    Now if you look at drop down in Theme location you should have that menu,select that and save.

    Using ftp you can rename that header.php file to say header-bak.php and create a header.php file paste header-bak.php file code in it and then in the code where you have

    <div class="nav">
    Your menu code here
    </div>

    Change that to

    <div class="nav">
    <?php /*
    
        Our navigation menu.  If one isn't filled out, wp_nav_menu falls
        back to wp_page_menu.  The menu assigned to the primary position is
        the one used.  If none is assigned, the menu with the lowest ID is
        used. */
    
        wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    </div>

    See if your menu works.

    Just in case it does not you still have backup header.php file the one we renamed.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Main navigation menu’ is closed to new replies.