SimpleFolio: Add Custom Menu Support

Posted March 6th, 2011 in Public and tagged , by Nick Cron

Adding support for custom menus is simple with WordPress.  Follow the steps described below to add custom support to your SimpleFolio themed site.

1. Add menu support to the theme:

Path: <root>/wp-content/themes/simplefolio/functions.php

Add at the end of the file before closing php  “?>”


add_theme_support( 'menus' );

2. Change header.php and add reference to custom menu

Path: <root>/wp-content/themes/simplefolio/header.php

Line 63


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

Replace the wp_lis+pages tag with your custom menu reference.


<?php wp_nav_menu( array('menu' => 'Main Navigation' )); ?>

Final:


<div id="pagenav">
<ul id="nav">
<?php wp_nav_menu( array('menu' => 'Main Navigation' )); ?>
</ul>
</div>

In this case the custom menu has the menu name “Main Navigation”.  Look at the WordPress function reference for additional ideas: WordPress Codex Function Reference – wp_nav_menu

3. Create the custom menu in WordPress – http://en.support.wordpress.com/menus/ – name the menu “Main Navigation”

Share this Post

  • Joe

    Thanks Nick. I can go in and change the menu alright, however the fact that Simplefolio uses Cufon to display the main menu is messing up the output. I’m not exactly sure which class/id triggers the right Cufon output. Any hints? I see that your page gets it right. What’s the secret?

  • Joe

    Never mind, I just figured out that I needed to add: ‘menu_class’=>’sf-menu’,'menu_id’=>’nav’ to the array contained in wp_nav_menu().

    Thanks again.

  • Jacky

    Nick, I’m not seeing general.php as a file in my theme? Any ideas on what I would need to do?

  • Anonymous

    Jacky – I guess that would be because I wrote the wrong file name. It should be functions.php

    Sorry about that! Post updated

  • abhay

    very good post. thanks for sharing.

  • Rob Hill

    This is great, but I’m getting weirdness. WP Menus page still shows that the theme supports 0 menus. With all the changes made, I get a vertically-formatted list of all pages in the header. Anyone else run into that?

  • Nick Cron

    Rob – Did you add the menu in the admin? You need to create one named “Main Navigation”

  • http://twitter.com/travismelvin travismelvin

    Thanks for the post and worked on my end. And thanks to Joe for the css menu comment. Appreciated

  • Oysiao

    Hi all, I’m trying to figure how works the navigation menu of SimpleFolio, but I got problems trying to modify it.
    I followed the instructions to make the menu editableBut now the menu falls down the header.my web is http://www.jlmirall.es/oysiaoAnyone can help me?Another problem I have is I don’t know how to put a menu item to link the home page with all the post (like the link of the image).sorry if I ask here, but the SimpleFolio webpage is not active now.

blog comments powered by Disqus