WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I edit my Menus? (8 posts)

  1. Brock Poling
    Member
    Posted 3 years ago #

    I am struggling with the SimpleFolio theme. The interface claims to allow me to select which elements (pages, posts, custom links) that appear in my menu, but regardless of what I try every new page I create gets included automatically in the top / bottom nav menu.

    I am not much of a coder, but I manage to stumble my way through it, can any one point me to where the menu items are kept so I can edit them directly?

    Here is my site (so far) if you would like to take a look: http://www.concealandcarryhq.com

    Thanks for any help you can provide.

  2. Brock Poling
    Member
    Posted 3 years ago #

    So digging some more, I have found this code in my header.php file

    <div id="wrapper">
    		<div id="header">
    			<div id="logo"><a href="<?php bloginfo('home'); ?>"><img src="<?php echo sf_get_logo(); ?>" alt="<?php bloginfo('name'); ?> - <?php bloginfo('description') ?>"/></a></div>
    			<div id="pagenav">
    				<ul class="sf-menu" id="nav">
    					<?php wp_list_pages('title_li='); ?>
    				</ul>
    			</div>
    		</div>

    I think what I need to do is replace the wp_list_pages function with the elements I have specified in a custom nav. (Yes?)

    Does anyone know where these custom nav elements are? Or what I would replace the wp_list_pages('title_li=') with to replace the listing of pages with the custom nav items?

    Thanks in advance for hour help.

  3. Zamphatta
    Member
    Posted 3 years ago #

    You don't have to touch the code in order to change what shows up in your nav menu. You just need to head into Appearance -> Menus

    There, you can slip any links & text you want to show up.

  4. Brock Poling
    Member
    Posted 3 years ago #

    Hey Zamphatta.

    Thanks for your response. Actually my problem is whenever I add new pages they always end up in my top / bottom nav menu automatically. I am unclear about how to add new pages and NOT include them in the nav.

    Do you have any thoughts on this?

    Thanks again for your help.

  5. esmi
    Forum Moderator
    Posted 3 years ago #

  6. Brock Poling
    Member
    Posted 3 years ago #

    Thanks esmi. I read all the documentation and I think I am close, but I am still struggling just a bit.

    I added this to my functions.php file

    /* Register Functions - Added to original theme */
    		function register_my_menus() {
     			register_nav_menus(
        				array('header-menu' => __( 'Header Menu' ) )
      			);
    		}
    		add_action( 'init', 'register_my_menus' );

    And in my header.php file I replaced this:

    <div id="pagenav">
    				<ul class="sf-menu" id="nav">
    					<?php wp_list_pages('title_li='); ?>
    				</ul>
    			</div>

    with this:

    <div id="pagenav">
    
    					<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
    
    			</div>

    When I do this I can now WHICH menu shows up (YEAH!!!!). But now the formatting is a bit screwed up. The menu is stacked on the far right and I have lost the original formatting.

    If I don't remove the <ul class="sf-menu" id="nav"> line the entire menu is missing. Clearly this is playing an important role in the formatting, but I haven't quite figured out what the conflict is.

    You can see it at http://www.concealandcarryhq.com

    I am close. Thanks again so much for your help.

    Do you have any thoughts on how I can recover the original formatting?

  7. nisaiy
    Member
    Posted 3 years ago #

    You can try with the following:

    <?php wp_nav_menu( array( 'theme_location' => 'header-menu',
    'menu_class' => 'sf-menu', 'menu_id' => 'nav'
    ) ); ?>

    Please take a look at this to configure the menu:
    http://codex.wordpress.org/Function_Reference/wp_nav_menu

  8. Brock Poling
    Member
    Posted 3 years ago #

    Success!!

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic