Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #52929
    Nijn
    Participant

    Hi,

    I have already used the (fixed) top menu for a menu, but I want to have another menu bar there (preferably even higher then the current top menu).
    I have gone through the default wordpress tutorials of creating an extra menu, but then my new menu ends up in the wrong place (below the top menu) and it does not stay fixed when scrolling down.
    Is it possible to create an extra menu-line on the top of the page?
    So I want the page to look like this:
    : first menu line (to be added, menu stays on page when scrolling)
    : second menu line (currently the top heading menu, menu stays on page when scrolling)
    : header image
    : main menu
    : page content

    Thanks a lot in advance!

    #52968
    Sakin
    Keymaster

    @Nijn: These are the extra features which cannot done from free support. You might need to consider hiring developer to work on it.

    To create extra menu, you need to build child theme first as all edits in the theme core files will be reverted back to original when you update your theme. Then after you make all the edit from the child theme, please post in your site URL and I can help you to make your new menu fixed with css.

    #53070
    Nijn
    Participant

    Hi Sakin,
    The URL for the website is http://www.mondzorgtraianus.nl
    I have created a child-theme (catch-Evolution-Child) and altered the header.php in the child-theme to include the additional menu.
    I could not get a second instance of the website running, so the additional (curently ugly looking) menu sits in the production site. To hide it from visitors I have altered the CSS to simply not display the additional menu.
    The menu is in the class “Top-Link-Menu-Class”.
    I want the new menu to look exactly the same as the current top-menu (the one with the options “spoed”, “contact” and “beheer”). The new menu should be on top of the screen, with the current top-menu (spoed, contact and beheer) just below it.
    Can this be done by just CSS?
    Thanks a lot in advance!

    #53178
    Sakin
    Keymaster

    @Nijn: Then you need to add your new menu below access-top wrapper ID.

    #53353
    Nijn
    Participant

    Hi Sakin,

    Thanks for your reply!
    I don’t think I understand you completely; I cannot find any “access-top wrapper ID” in the header.php.
    A snippet of the header.php:

    	<header id="branding" role="banner">
        	<?php 
    		/** 
    		 * catchevolution_before_headercontent hook
    		 *
    		 * @hooked catchevolution_header_topsidebar - 10
    		 */
    		do_action( 'catchevolution_before_headercontent' ); ?>
            
        	<div id="header-content" class="clearfix">
            
            	<div class="wrapper">
    				<?php 
    				// *** ADD CUSTOM MENU
    				// ***
    				wp_nav_menu( array( 'theme_location' => 'Top-Link-Menu', 'container_class' => 'Top-Link-Menu-Class' ) );
    				// ***
    				// *** END OF CUSTOM MENU ADDITION
    				
                    /** 
                     * catchevolution_headercontent hook
                     *
                     * @hooked catchevolution_headerdetails - 10
                     * @hooked catchevolution_header_rightpsidebar - 15
                     */
                    do_action( 'catchevolution_headercontent' ); ?>
                </div><!-- .wrapper -->
                
          	</div><!-- #header-content -->
            
        	<?php 
    		/** 
    		 * catchevolution_after_headercontent hook
    		 *
             * @hooked catchevolution_header_menu - 10
    		 */
    		do_action( 'catchevolution_after_headercontent' ); ?>           
            
    	</header><!-- #branding -->
    

    Have I inserted the code for the custom menu in the right place?
    Thanks!

    #53372
    Sakin
    Keymaster

    @Nijn: First you need to build child theme and then in your child theme functions.php file you need to add code like below, where you need to add your menu code in the function below:

    function catchevolution_below_header_top_menu() { 
    	// Add your menu code here
    }
    add_action( 'catchevolution_before_header', 'catchevolution_below_header_top_menu', 15 );
    #53452
    Nijn
    Participant

    Hi Sakin,
    I have created a child-theme, and altered the functions.php so it looks as follows:

    <?php
    // ** Add menu 
    function catchevolution_below_header_top_menu() 
    { 
    register_nav_menu('Top-Link-Menu',__( 'Menu top for Links' ));
    }
    add_action( 'catchevolution_before_header', 'catchevolution_below_header_top_menu', 15 );
    
    // Add custom CSS
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
    function enqueue_parent_theme_style() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    ?>
    

    I don’t see the secondary menu appear in the HTML code (it’s not on the screen because the display:none is still in the css), and now the regular menu no longer lists the items left to right, but top to bottom (please check http://www.mondzorgtraianus.nl).
    Any ideas?

    #53486
    Nijn
    Participant

    Don’t know hwy IE suddenly rendered the menu in the wrong direction. Looks good again. So current site is okay, new menu still doesn’t show up.

    #53558
    Sakin
    Keymaster

    @Nijn: Register nav menu should be in that hook. You need to register menu in theme setup function and then call in that hook. This is bit complicated so you might want to hire developer to work on it.

    #53855
    Nijn
    Participant

    Hi Sakin,

    Thanks, I imagined things less complicated than this
    I will use another (already present) menu location instead.

    #54824
    Nijn
    Participant

    Just to let you all know:
    I fixed it by installing a links widget and using one of the widget areas to display it.
    Works like a charm!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Create extra fixed menu on top?’ is closed to new replies.