Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST

In regards to the COVID-19 situation

Your support team is currently doing their best to offer the best support possible despite the current COVID-19 situation. However during these exceptional circumstances, please note that you should expect a response time of 2-3 business days, until further notice.Rest assured that we will still do our best to handle your requests as soon as possible! Everyone stay safe and healthy! 😷

Change menu layout in header

This topic is resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Jon
    Participant
    • 3 Topics
    • 4 Posts
    @jinsley8

    Hi,

    I have my main menu centered in the middle of my header. Do you know which file the header can be edited in?

    I want to disable the menu for logged-in users and replace with a search bar but can’t find the file to edit.

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1673 Posts
    @themosaurus

    Hi Jon,

    The main menu is displayed by the gwangi_grimlock_navbar_nav_menu function located in inc/grimlock/grimlock-template-functions.php in your Gwangi theme. However I would advise against modifying the code directly in Gwangi as all your custom changes will be deleted when you update Gwangi.

    Here is a code snippet I built that you can use as a base to hopefully help you achieve your goal:

    if ( ! function_exists( 'gwangi_grimlock_navbar_nav_menu' ) ) :
    	/**
    	 * Prints the wp nav menu inside Grimlock Navbar.
    	 *
    	 * @param array $args The array of arguments for the navigation menu.
    	 */
    	function gwangi_grimlock_navbar_nav_menu( $args ) {
    		if ( is_user_logged_in() ) : ?>
    			<ul class="nav navbar-nav navbar-nav--search">
    				<li class="menu-item">
    					<div class="navbar-search">
    						<?php get_search_form(); ?>
    					</div><!-- .navbar-search -->
    				</li>
    			</ul>
    		<?php else :
    			if ( has_nav_menu( 'primary' ) ) :
    				wp_nav_menu( wp_parse_args( $args, array(
    					'theme_location' => 'primary',
    				) ) );
    			endif;
    		endif;
    	}
    endif;

    To add this code snippet to your website without directly modifying Gwangi files, you can either use the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/) or create a child theme and add the snippet to the functions.php file of that child theme (if you are not already using one of our child themes).

    If you need more information about adding custom PHP to your website, I invite you to read these articles of our documentation:

    Adding Custom PHP Without Changing Your Child Theme

    Creating a Child Theme

    Please keep us updated if it helped you achieve your goal.

    Best regards,

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Change menu layout in header’ is closed to new replies.

Troubleshooting Demo Imports

You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.

Happy With our Support So Far?

Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️