WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Modifying wp_nav_menu? (2 posts)

  1. DeNiro
    Member
    Posted 3 years ago #

    Hi there!

    I'm working on a small WordPress plugin and I got stuck.

    I have 10 pages and <?php wp_nav_menu(); ?> shows all the names and links to them.

    I want to cut these to the first 4 pages and sort them by sort order (sort_order).

    Or maybe there's a way with <?php get_pages() ?>?

    Thanks!

  2. DeNiro
    Member
    Posted 3 years ago #

    RESOLVED:

    <?php wp_list_pages('sort_column=menu_order&title_li=&number=4&'); ?>

    Don't get why wp_nav_menu is less flexible than wp_list_pages (won't use _wp_nav_menu at all, because seems pointless to me).

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic