GeoDirectory SupportGeodirectory Menu on Location page only – GeoDirectory Support https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/feed Tue, 24 Feb 2026 07:24:42 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11103 <![CDATA[Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11103 Tue, 05 Aug 2014 22:28:37 +0000 fbernall Greetings,

I’m not using the geodirectory as my my homepage. I would like the geodirectrory menu to only show when someone is navigating the geodirectory framework pages such as listings, etc. I want my home page to only show a link to the directory plus other links to my own content.

I’ve tried creating a new header.php renamed to homeheader.php and included in the get_header argument the name of the header as such: <?php get_header(‘homeheader’); ?>. Then I removed the wp_nav_menu(array from the new header. However the menu still shows.

Any help or guidance would be appreciated..

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11106 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11106 Tue, 05 Aug 2014 23:07:33 +0000 Simone Hi,

your attempt could be successful if you make a condition where the new header will be loaded only if it is_home() or any other page you want to exclude the GD links….or you can explore the world of the GD hook_actions .. 🙂

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11109 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11109 Tue, 05 Aug 2014 23:11:48 +0000 fbernall Thanks, Simone. Here’s what I placed on index.php and did not work:
<?php
if ( is_home() ) :
get_header( ‘homeheader’ );
elseif ( is_404() ) :
get_header( ‘404’ );
else :
get_header();
endif;
?>

Not sure what else to do.. Thanks again..

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11110 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11110 Tue, 05 Aug 2014 23:29:52 +0000 Simone Hi,
do not edity the index, you can either create a functions or just edit the current header.

Right before the array with the nav menu, use the if else statement and use is_frontpage rather than is_home.
i’ve tested on my website this, and it works


 if ( is_front_page() ) :
	echo "home";
	 elseif ( is_404() ) :
echo "404";
else :
	 
	  wp_nav_menu(array(
    					'container' => false,                           // remove nav container
    					'container_class' => 'menu cf',                 // class of container (should you choose to use it)
    					//'menu' => __( 'The Main Menu', GEODIRECTORY_FRAMEWORK ),  // nav name // removed because it was breaking WPML lang switcher
    					'menu_class' => 'nav top-nav cf',               // adding custom nav class
    					'theme_location' => 'main-nav',                 // where it's located in the theme
    					'before' => '',                                 // before the menu
        			'after' => '',                                  // after the menu
        			'link_before' => '',                            // before each link
        			'link_after' => '',                             // after each link
        			'depth' => 0,                                   // limit the depth of the nav
    					'fallback_cb' => ''                             // fallback function (if there is one)
						)); 
						
						endif;
						?>
]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11117 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11117 Wed, 06 Aug 2014 00:09:02 +0000 fbernall thanks again Simone. So are you duplicating header.php for this?

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11118 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11118 Wed, 06 Aug 2014 00:09:54 +0000 Simone Not duplicating, just using the header (in the child theme) and added the modifications above

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11124 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11124 Wed, 06 Aug 2014 00:43:15 +0000 fbernall ok, so I want an entire different menu on my homepage, one that includes other pages than the ones created by GDF. So, are you saying to create a new menu, call it “home” or whatever, and then include the above code on my header.php? What if I wanted that new menu to also appear on the “author”s page?

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11185 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11185 Wed, 06 Aug 2014 18:15:49 +0000 Paolo Yes, copy header.php inside your child theme and use use the conditional tag :


geodir_is_geodir_page()

That way if it is a geodirectory page you can use 1 menu, else you use the extended one for all other non GD pages…

Let us know,

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11189 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11189 Wed, 06 Aug 2014 18:33:08 +0000 fbernall Thanks Paolo. Can you elaborate a bit more on the code? I got it working in a different way, but it has some bugs..
Would it be something like:

<?php if(geodir_is_geodir_page() ){
wp_nav_menu( array( ‘theme_location’ => ‘custom_menu’, ‘fallback_cb’ => ‘fallback_menu’ ) );
} else
wp_nav_menu(array(‘container’ => false, ‘container_class’ => ‘menu cf’,
‘menu_class’ => ‘nav top-nav cf’, ‘theme_location’=>’main-nav’,
‘before’ => ”,
‘after’ => ”,
‘link_before’ => ”,
‘link_after’ => ”,
‘depth’ => 0,
fallback_cb’ => ” ));
endif;?>
thanks again..

]]>
https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11225 <![CDATA[Reply To: Geodirectory Menu on Location page only]]> https://wpgeodirectory.com/support/topic/geodirectory-menu-on-location-page-only/#post-11225 Wed, 06 Aug 2014 21:20:00 +0000 Paolo Hi,

1st you need to register a new menu location in your child theme style.css: http://codex.wordpress.org/Function_Reference/register_nav_menu
example:


<?php
register_nav_menu( 'gd', 'GD Menu' );
?>

Than copy header.php from main theme to child theme, open it and change:


 wp_nav_menu(array(

    					'container' => false,                           // remove nav container

    					'container_class' => 'menu cf',                 // class of container (should you choose to use it)

    					//'menu' => __( 'The Main Menu', GEODIRECTORY_FRAMEWORK ),  // nav name // removed because it was breaking WPML lang switcher

    					'menu_class' => 'nav top-nav cf',               // adding custom nav class

    					'theme_location' => 'main-nav',                 // where it's located in the theme

    					'before' => '',                                 // before the menu

        			'after' => '',                                  // after the menu

        			'link_before' => '',                            // before each link

        			'link_after' => '',                             // after each link

        			'depth' => 0,                                   // limit the depth of the nav

    					'fallback_cb' => ''                             // fallback function (if there is one)

						));

with :



 if(geodir_is_geodir_page() ){

 wp_nav_menu(array(

    					'container' => false,                           // remove nav container

    					'container_class' => 'menu cf',                 // class of container (should you choose to use it)

    					//'menu' => __( 'The Main Menu', GEODIRECTORY_FRAMEWORK ),  // nav name // removed because it was breaking WPML lang switcher

    					'menu_class' => 'nav top-nav cf',               // adding custom nav class

    					'theme_location' => 'gd',                 // where it's located in the theme

    					'before' => '',                                 // before the menu

        			'after' => '',                                  // after the menu

        			'link_before' => '',                            // before each link

        			'link_after' => '',                             // after each link

        			'depth' => 0,                                   // limit the depth of the nav

    					'fallback_cb' => ''                             // fallback function (if there is one)

						)); }
else { wp_nav_menu(array(

    					'container' => false,                           // remove nav container

    					'container_class' => 'menu cf',                 // class of container (should you choose to use it)

    					//'menu' => __( 'The Main Menu', GEODIRECTORY_FRAMEWORK ),  // nav name // removed because it was breaking WPML lang switcher

    					'menu_class' => 'nav top-nav cf',               // adding custom nav class

    					'theme_location' => 'main-nav',                 // where it's located in the theme

    					'before' => '',                                 // before the menu

        			'after' => '',                                  // after the menu

        			'link_before' => '',                            // before each link

        			'link_after' => '',                             // after each link

        			'depth' => 0,                                   // limit the depth of the nav

    					'fallback_cb' => ''                             // fallback function (if there is one)

						));}

I haven’t tested it, but this should work.

]]>