There is no easy way to alter the vale of each li in the wp_page_menu
but there is a way to do it without creating your own function or custom walker using the_title
filter hook.
so create your function , something like this:
function custom_menu_title($title,$post_id){
return $title . ' ' . get_post_meta($post_id,'meta_key',true);
}
and you hook it before you call wp_page_menu
and remove it right after so:
add_filter('the_title','custom_menu_title',10,2);
wp_page_menu(array(...));
remove_filter('the_title','custom_menu_title',10,2);
Related Posts:
- Customizing Only a Specific Menu using the “wp_nav_menu_items” Hook?
- How make top level menu item not have link, but have sub-menus that are linked?
- How to Hard Code Custom menu items
- How Does The Walker Class Work?
- Calling the Menu Title within wp_nav_menu array function
- How to stop mobile theme inheriting desktop navigation menu?
- Increase search results for Admin -> Appearance -> Menus -> Search (default is 10)
- How to hide an item from a menu to logged out users (without a plugin)
- Large WP 3.0 menu times out and won’t save
- How do I add the data-toggle=”modal” data-target=”#myModal” attribures to a WP Nav bar?
- How to switch between the Primary Menus programmatically?
- if role is logged in then do something
- Terms with more than one occurrence have current-menu-item class in menu
- Nav menu items disappearing (but not immediately)
- start_lvl on Walker is not working
- How to get Menu Navigation Labels to output HTML
- custom menu not found
- How to add text before WordPress menu item href
- Nav walker, bootstrap: Display 3rd level items under 2nd level
- Remove nav_menus from customizer using a theme
- Pending Custom Link in Menu
- Benefits of using Nav Walker?
- display only the wp_nav_menu, which has the current-menu-item
- Add tabindex to navmenu
- wp_list_pages sort order is different for different languages [closed]
- has_children in custom nav_walker
- I’m having a lot of trouble since upgrade to 3.0.1 with get_page_children() function
- How can I add a link to a WPForms “contact us” form to the main menu?
- How to add wechat (weixin) link to navigation menu?
- Create search form in menu as in Twenty Fourteen theme
- Add link at the end of wp_nav_menu
- Link that refers to a menu item with dynamically generated URL
- How to add programmatically all pages and children to backend menu
- WordPress 3.5 dropdown menu
- WP Menu Walker – How to know total depth from inside the start_lvl() method
- How do I add recent posts to the menu?
- Conditional secondary menus
- delete all post with certain meta_keys
- how to add custom wp_nav_menu class css selector to ul and a tags?
- Creating a menu containing categories and authors
- Change submenu markup
- Split into two seperate unordered lists with custom walker
- Can’t add a setting to the “nav_menus” customizer panel
- Use another menu when logged in
- How to remove UL class in wp_nav_menu?
- Displaying menu based on login status
- Adding an external link to wordpress menu
- Highlighting top level link when viewing one of it’s sub-pages, which are not linked in the menu
- Make menu items open in new tab/page
- Add a counter beside menu item label
- Why is my array of nav menus returning empty?
- Adding top level items in the admin menu that link to a post
- How do I hide “Pages”, “Media”, “Comments”….for editor role?
- Twenty Fifteen: Change navigation menu behavior
- Need a menu on left sidebar of the page with below requirements [closed]
- add login menu with submenu
- How to make top level menu think it has a current item
- Generate Navbar In WordPress
- Showing home button in a specified menu
- What’s the best way to customize the WordPress Menu Page (in admin)
- Catagorized hierarchy menu for PAGES!
- Making the menu toggled open on mobile devices Illustratr theme
- How to include second layer sub menu to Walker Nav?
- need help in wordpress navbar setup
- Event listener callback returns undefined element
- Add class to sub-menu from unrelated element
- How can I creat custom menu with bootstrap
- Add CSS Class to WordPress Menu Item Dependent on the Page the User is Visiting
- Restrict user to edit only edit a certain menu
- Menu walker: how to tell if a sub menu contains submenus?
- How do i make a custom top level dashboard menu item available for all users?
- Getting parent object_id of child menu items in WordPress menu
- How to remove a sub-menu using walker hooks/filters without relying on a custom walker?
- Walker or wp_get_nav_menu_items VS jQuery
- I can’t correctly display menu
- Calling wordpress menu outside ignores custom menu item
- Specific Page that convert Hyperlink to anchor in nav menu
- How can I make this custom design menu work in wordpress?
- Active menu item / category
- Add different span class to wp nav menu
- Disappearing items in menu
- Menu not saving in dashboard
- Help with changing style of the extended menu drop down [closed]
- Where these arguments are defined?
- How do i keep my current page menu highlighted on pagination?
- How we show pages in dropdown
- Menu support for touch devices
- WordPress Flyout Menus
- wp_nav_menu doesn’t show on index page
- Pick out specific menu item from code
- Show All Children of WordPress Menu
- Elegant way of adding an CTA to a menu
- highlight parent page on menu when child page is on sidebar (and not on menu)
- nav tag wrapping around dropdown
- How to set menu Display location
- How to add custom menu to block theme?
- get menu name for the current displayed page
- Sub menu for a (single) page
- Add acf custom fields so sub item in menus
- change breakpoint widths for divi theme tablet view