SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Introduction, First post and custom menus

    Hi there, first post so bare with me!

    Long time lurker and client for sitepoint books, and I thought this is the right moment to become an active member,

    I have a question about custom menus, see, I'm trying to understand the whole custom menu thing, but still not sure where to place things, hope somebody can send me in the right path, so here I go:

    In my functions.php I got this:

    PHP Code:
    add_theme_support('nav-menus'); if ( function_exists('register_nav_menus')) {
    register_nav_menus( array(
    'main' => 'Main Nav'
    ) );

    Then, I have the menu structure like this:

    HTML Code:
    <div class="navbar">
    <div class="navbar-inner">
    <div class="container">
    <ul class="nav">
    <li class="active"><a href="#">Main Item</a></li>
    <li><a href="#">Item</a></li>
    <li><a href="#">Item</a></li>
    <li><a href="#">Item</a></li>
    </ul>
    </div>
    </div>
    </div>
    Then I have this, I assume, to call the dynamic menu:

    PHP Code:
    <?php wp_nav_menu( array('menu' => 'Main''container' => 'nav' )); ?>
    So, at this point all what I have, those separated elements are ok, the question is, where is this going to be placed: <?php wp_nav_menu( array('menu' => 'Main', 'container' => 'nav' )); ?> or what should I do in order to make the dynamic menu works with my styles?

    Thanks in advance!

    A.

  2. #2
    SitePoint Addict deadmix's Avatar
    Join Date
    Jun 2009
    Location
    france
    Posts
    210
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You add this "<?php wp_nav_menu( array('menu' => 'Main', 'container' => 'nav' )); ?>" where you need the Menu to appear, i assume in header.php ...

    That's all


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •