Forums

wp_list_pages with Navigation label (3 posts)

  1. rchiriboga
    Member
    Posted 5 months ago #

    Does anyone know how to make it so that I can use the navigation label instead of the page name in the wp_list_pages?

    `wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&sort_column=menu_order&depth=1");

  2. Marventus
    Member
    Posted 5 months ago #

    Hi,

    AFAIK, navigation labels are for custom menus only. You could try to use wp_nav_menu instead of wp_list_pages, but in that case you would have to either call an existing menu or register a new one.
    Let me know if this makes sense to you.

    Cheers!

  3. viewspro
    Member
    Posted 5 months ago #

    I think #Marventus is right. But if you don't want to use wp_nav_menu, you can add a Custom Field say NavLabel to each page.

    Use get_pages('meta_key'='NavLabel') to retrieve all pages that has values for the NavLabel custom field. Note though you will lose page tree-like structure.

Reply

You must log in to post.

About this Topic