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

Due to the decrease in our staff due to vacations, our response time may be longer.

Be sure we're doing our best to manage your topic as soon as possible.

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
    • 1675 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 ❤️

Discover MatchPress

Skip • Like • Super-Like

Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.

Setup Your Cera or Gwangi powered Community Website and Turn it into an iOS and Android App

15% discount for Cera users

To unleash the full power of your Cera or Gwangi theme, we have partnered with the Zipline team. Your community website can now be fully setup and turned into your very own custom app for iOS and Android.

Whether you've newly acquired the theme or already got your site up and running, Zipline got you covered. And we got you an incredible discount.

Holiday, Weather & Festive effects
to pimp your WordPress Site