WordPress.org

Ready to get started?Download WordPress

Forums

Main navigation menu (24 posts)

  1. c.devlin
    Member
    Posted 1 year ago #

    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

  2. govpatel
    Member
    Posted 1 year ago #

    Without looking at exactly how the theme coded is hard for us help you is this a wordpress theme.

  3. c.devlin
    Member
    Posted 1 year ago #

    Here is the header.php

    [Please use a pastebin for large amounts of code
    http://codex.wordpress.org/Forum_Welcome#Posting_Code ; and always use the code buttons here ]

  4. govpatel
    Member
    Posted 1 year ago #

    @c.devlin@ala.asn.au You will need paste the code in http://wordpress.pastebin.com and paste the url here

  5. c.devlin
    Member
    Posted 1 year ago #

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

    http://pastebin.com/cTyB8jQw

    This is the header.php:

    http://pastebin.com/EhKP8DsX

  6. govpatel
    Member
    Posted 1 year ago #

    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.

  7. c.devlin
    Member
    Posted 1 year ago #

    ?? - sorry

  8. govpatel
    Member
    Posted 1 year ago #

    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

  9. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

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

    http://codex.wordpress.org/Navigation_Menus

  10. c.devlin
    Member
    Posted 1 year ago #

    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.

  11. c.devlin
    Member
    Posted 1 year ago #

    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

  12. govpatel
    Member
    Posted 1 year ago #

    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.

  13. c.devlin
    Member
    Posted 1 year ago #

    Nothing has been selected for the theme location.

  14. govpatel
    Member
    Posted 1 year ago #

    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.

  15. c.devlin
    Member
    Posted 1 year ago #

    it says primary navigation:

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

  16. govpatel
    Member
    Posted 1 year ago #

    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.

  17. c.devlin
    Member
    Posted 1 year ago #

    Thanks, I've created the menu. All good there. I haven't assigned it as yet to the primary location as yet. I'm wondering if the theme has been customised - which it clearly has - will there be issues re: where the navigation information sits and how it looks?

  18. c.devlin
    Member
    Posted 1 year ago #

    OK, so can I just confirm - that I just set the new menu to the primary position and then in the header.php - change it from this":

    <div class="nav">
          <ul>
            <li><a href="<?php bloginfo('url');?>">Home</a></li>
            <li><a href="<?php bloginfo('url');?>/about-us">About us</a></li>
            <li><a href="<?php bloginfo('url');?>/adult-learning">Adult learning</a></li>
    	<li><a href="<?php bloginfo('url');?>/contact-us/">Contact us</a></li>
            <li><a href="<?php bloginfo('url');?>/policy-representation/">Policy</a></li>
            <li><a href="<?php bloginfo('url');?>/publications/">Publications</a></li>
            <li><a href="<?php bloginfo('url');?>/professional-development/">Professional development</a></li>
          </ul>
        </div>

    To this:

    <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>
  19. govpatel
    Member
    Posted 1 year ago #

    We are just testing to see if will work as there may be some changes to be made in style.css for your nav Class as this used for your menu.

  20. c.devlin
    Member
    Posted 1 year ago #

    ok thx

  21. c.devlin
    Member
    Posted 1 year ago #

    Thanks so much for all your help govpatel. I've created a test site and this is what happened when I made the changes:
    http://communitylearning.net.au/

  22. govpatel
    Member
    Posted 1 year ago #

    Did you assign the custom menu in Appearance>>>Menus as Looks like still opens your sidebar menu.

  23. dilippachanouri
    Member
    Posted 6 months ago #

    hi
    i have started creating website site i have installed ifeature theme while creating the navigation menu some unwanted space appeared so how to delete the space in navigation menu.

  24. councilofnomads
    Member
    Posted 5 months ago #

    my site is councilofnomads.com

    I'm using wordpress and Arcon theme. I can't get my menu to show up on my homepage. I can see the menu when I go to appearance and customize. i select the menu under navigation and hit save and it shows on the page. however, when i go to my pages and select preview (after its published) it shows the red box that says "define menu".

    i have set up the menu and dragged the appropriate pages over, and selected theme location. when i select theme location I then save. but after saving the theme location box is unchecked again.

    thanks for any help

Topic Closed

This topic has been closed to new replies.

About this Topic