WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to get rid of default Home Page tab in menu? (5 posts)

  1. Heropass
    Member
    Posted 3 years ago #

    Ok so I wanted a static page for my site as seen here: http://automata-theatre.netau.net/ and I made it through reading settings. The only problem I am having is that this template has a static "Home" page tab in the top menu. So I have two "home" tabs. I was wondering how I could change this. This template from what I can tell doesn't have the code wp_list_pages in the header.php but instead has this code:

    <!-- begin top menu -->
    		<div id="topMenu">
    		<?php if ( function_exists( 'wp_nav_menu' ) ){
    				wp_nav_menu( array( 'theme_location' => 'top-links', 'container_id' => 'topLinks', 'fallback_cb'=>'toplinks') );
    				}else{
    					toplinks();
    				}?>
    				</div>
    		<!-- end top menu -->

    So what do I have to do, change, to get this issue worked out, please?

    Thanks in advance!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Try adding:

    function my_page_menu_args( $args ) {
    	$args['show_home'] = false;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'my_page_menu_args' );

    to your theme's functions.php file.

  3. Heropass
    Member
    Posted 3 years ago #

    I tried adding it, but it didn't do anything for me. Was there a specific place this code is supposed to go inside functions.php. I added this code to:

    }	
    
    if ( function_exists( 'wp_nav_menu' ) ){
    	if (function_exists('add_theme_support')) {
    		add_theme_support('nav-menus');
    		add_action( 'init', 'register_my_menus' );
    		function register_my_menus() {
    			register_nav_menus(
    				array(
    					'top-links' => __( 'Top Links' ),
    					'main-menu' => __( 'Main Menu' ),
    					'footer-links' => __( 'Footer Links' )
    				)
    			);
    		}
    	}
    }

    Could you show me where exactly I ought to paste this code?

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Don't add it to an existing function. Just add it to the functions.php file after the <?php and before the ?> tags.

  5. Heropass
    Member
    Posted 3 years ago #

    No luck then. It doesn't work for me.

Topic Closed

This topic has been closed to new replies.

About this Topic