Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End about wordpress menus

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #37301
    shamai
    Member

    so I’m new to wordpress and I’m currently reading digging into wordpress
    I have been waiting for a certain topic to come up in the book, but it hasn’t so i have come here ask

    how do you make menus?

    normally in a static site I make nav>ul>li and i style the li’s with css accordingly

    but I’m guessing its suppose to be dynamic using wordpress functions to pull in the pages or categories depending on user preferences.

    im guessing a while loop is needed to search through all your pages and then display them and style them.
    but I can’t find any loops about pages or categories…only posts

    or is the navbar supposed to be static links? I mean I guess I wouldn’t want every category listed there

    how do people normally do this?

    #99744
    kobylecki
    Member

    I usually use function wp_list_pages()

    Read a docs: http://codex.wordpress.org/Function_Reference/wp_list_pages

    And my use case:

    You can include only some pages or exclude some of them. Sort specific by order from administration or set by hand. Any you can think of.

    #99759
    shamai
    Member

    cool!
    thanks!

    i am looking at websites and seeing how they make them. I see some websites mix and match categories and tags in their menu

    would that be listing categories and omitting some and listing tags and omitting some?

    #99762
    shamai
    Member

    aha
    i have discovered the new wp 3.0 menu system
    but it doesn’t seem to include the option for tags

    #99810
    Kermet
    Member

    http://codex.wordpress.org/Function_Reference/wp_nav_menu

    You create the menu in the backend, filling it with whatever you need, then you print to the frontend with wp_nav_menu(array(‘menu’ => ‘mymenuname’));

    You really don’t need more than that for 99% of sites…

    #99893
    shamai
    Member

    I’m going to have to figure out how to style that

    #99919
    JoshWhite
    Member

    What I’d recommend is copy TwentyTen or TwentyEleven themes… both of those have a pretty straight forward method. Grab the code out of the header that looks like this:

     'menu-header', 'theme_location' => 'primary' ) ); ?>

    Then the CSS will be this block here:


    #main-nav .menu-header,
    div.menu {
    }

    #main-nav .menu-header ul,
    div.menu ul {
    }

    #main-nav .menu-header li,
    div.menu li {
    }

    /* main menu links */
    #main-nav a {
    }

    #main-nav a:hover {
    }

    #main-nav ul ul {
    }

    #main-nav ul ul li {
    }

    #main-nav ul ul ul {
    }

    /* sub menu links */
    #main-nav ul ul a {
    }

    /* Sub menu hover */
    #main-nav ul ul :hover > a {

    }

    #main-nav ul li:hover > ul {

    }

    That will at least get you into working with them dynamically through the dashboard. Don’t stop learning there there, but that will begin to give you a sense of adding additional menus, drop downs, sub layers, etc

    #99941
    shamai
    Member

    thanks!
    im gonna play around

    #99955
    TheDoc
    Member

    I like the menu feature when it came out, but since then I’ve found it to simply get in the way, especially on larger websites.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Back End’ is closed to new topics and replies.