You can use Walker: extend the Walker_Nav_Menu class in your functions.php
class custom_nav extends Walker_Nav_Menu {
function start_el (&$output, $item, $depth, $args) {
$item_output="<a href="" . $item->url. '" someattr="somevalue">' . $item->title . '</a>';
$output .= '<li>' . apply_filters ('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
}
}
and call it in wp_list_pages
<?php wp_list_pages(array( 'walker' => new custom_nav ())); ?>
Related Posts:
- Shortcode producing headers already sent error
- Change ul class=”children” for wp_list_pages?
- Manipulate Output of wp_list_something: select menu instead of li’s
- List child pages of specific page using shortcode
- How to get specified parent page title in my function
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- new_excerpt_more link not working properly
- Using depth=n in wp_list_pages
- Sort and display pages with specific custom field (not tag)
- How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?
- Get the ID of the page a menu item links to?
- Add container to nav_menu sub menu
- One Child Functions.php for Multiple Child Themes
- Different wp_mail_from and wp_mail_from_name for specific situations
- Disabling pingback and trackback notifications
- register_post_type for Pages?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- How to get comments with mixed status using get_comments?
- Restrict user registration to emails on a single domain
- Call to undefined add_action() in theme’s functions.php
- How can I rename the WordPress AJAX URL? [duplicate]
- How to add a rel attribute to images that contains their categories?
- Is it possible to be more page/post specific with admin_enqueue_script?
- Can I use require() function in a template file?
- What is the most efficient method for loading widgets in functions.php
- Enqueue script o style only if a template part is loaded
- Can I pass two roles to the function get_users?
- Add external js file to footer with id
- password protected post policy
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- How can I enable uploading excel files?
- Logout hyperlink within a sub-menu
- Manipulate Permalink
- Change the HTML of the comment form that is generating somewhere from the core WordPress
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Twentyten Child Theme: header images display messed up in admin panel
- How to get the index number of the posts?
- Removing wp_login_viewport_meta
- Get Current Post ID in functions php, meta query filter
- Custom Attachment Caption Fields
- Jquery implementation not working on page reload
- Call WordPress function outside of WordPress
- Move Custom Fields on General Settings Page to New Location
- Remove adjacent_posts_rel_link under 3.2?
- enqueue_script with filemtime javascript not working
- WP function won’t work on 404 template page
- How to obtain the recent posts without their content in an efficient way?
- Limit dimensions of “Full” size images
- Where to put random functions?
- Define PHP variable from a seperate API if statement
- Auto-Tweet if Type is ‘Status’ using OAuth
- Output a specific link in WordPress post if the single post’s category’s name contain certain word
- How to add custom li item to wordpress menu
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- Passing user enetered value in widget: number of words, for example
- Adding a section in line at the end of the main navigation menu in php
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Suggest Users basing on User taxonomy
- Code to insert code into single php
- update_post_meta is Updating with two page id
- Custom Image Size in Insert Media
- Custom function for search form
- Custom Menu in Admin doesn’t change menu in browser
- How can I show different content for different user-levels?
- WordPress function bloginfo not echoing output on parts of the pages
- How to change a meta value (of a published post) after X days.?
- sort metabox columns in listing Single
- wp_nav_menu displaying all pages
- How to change text color depending on the number value (Using javascript)
- Why should I use get_template_directory() when include files?
- How to display an image before title text in menu items
- Error in “class-wp-hook.php”
- How to replace ACTION url from original wordpress login form?
- Redirect User Role When on Specific Page
- How to force one script to load before google tag manager script
- Ajax in plugin fails – but only on one blog – no idea why
- I can’t in any way include css in my theme using functions.php
- Problem with email function
- admin-ajax.php 403 forbidden only when calling from external file
- Remove post from latest posts after a month only with certain tag
- Display list of pages that contain a certain string within the slug
- I need to completely ‘wp_dequeue_script’; what’s the best way?
- $content is empty while using DOMDocument
- Change the second role depending on the first
- wordpress not calling peliegro functions.php?
- Problem with add_rewrite_tag
- getExcerpt: Make ellipsis appear only if character limit is reached
- Modify function Shortcode_atts
- Full size image option removing problem
- Limit length of headline in Editor
- Add custom fields after post/page title
- Ajax call does not work for this custom code
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- Add the title of a widget as an ID – for anchor links
- Why my wp_enqueue_script doesnt work on some page?
- Need to use an external variable inside a function
- Trying to get this function to show below the content
- Correct php syntax to add an image in wp functions.php
- Problem with removing characters “<” – WpAllImport