Are you looking to put a title on the nav links? That is built into the Menu feature in WordPress.
But this applies to the tag and not the <li>
as you specified. You can, however, apply a class to the <li>
by clicking the “Screen Options” link while in the Menu Admin page. Then, find the “CSS Class” checkbox under “Show advanced menu properties”.
Finally, you could give your links the desired title and then apply the following jQuery to apply the title to the <li>
and remove it from the <a>
.
$(function() {
$('ul li').each(function() {
var linkTitle = $(this).find('a').attr('title'); //get the link title
$(this).attr('title', linkTitle); //apply the title to the li
$(this).find('a').removeAttr('title');
});
});
JSFiddle example: http://jsfiddle.net/tmort/E5VzC/3/
Related Posts:
- Add Dividers or Separators Between Nav Menu Items
- Replacing WordPress menu functionality with a plugin
- PHP 7 – Class Method Compatibility Issue
- Custom code for WordPress dynamic menu
- How do I access the menus produced by Dashboard > Appearance > Menus
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- add_menu_page() with different name for first submenu item
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Change the_title() of a page dynamically
- How do I programatically insert a new menu item?
- Nav Menu meta failing to import
- Overwriting Core WordPress Functions with Plugins
- Some nav-menu filters do nothing
- Determine which theme location a wp_get_nav_menu_items is for
- Can I add pages to my custom menu via script?
- Hook event for upload image in the menu
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- How do I approach removing menu items on the fly based on settings in my plugin?
- What is the difference between current_page_parent and current_page_ancestor?
- Delete a specific item menu when I deactivate my plugin
- Create a Page via plugin
- Add Submenu Link in add_submenu_page That Opens in a New Window
- How to assign a WP 3.0 custom nav menu to a theme’s navigation menu location via script?
- Header Button Chance Polylang Elementor
- How to add pages to custom menus on the fly [duplicate]
- How do I add a custom sublevel menu specified in one directory to a custom top level menu specified in another directory?
- Add notification bubble notice in navigation using transients
- Get Current Menu Location inside Nav_Walker
- Adding custom fields to WordPress nav menus
- Sub Menu content is being duplicated
- Plugin menu addition in multisite
- Remove unwanted elements for a wp_nav_menu
- Is this best practice for Dynamically adding items to WordPress menus?
- How to remove or add submenu item on plugin activate or deactive
- wordpress add_submenu_page adds broken link
- WP Enqueue style on all plug-in pages
- Add child pages to submenu automatically
- Customize existing menu item
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- Issue with plugin sub menu and pages
- How to add Plugin functionality in WordPress Frontend Menus
- How to hide page links from theme menu
- WP_NAV_MENU filter targets all menus
- How do I add a menu item to a Pods admin menu?
- How to create archive page to add in menu
- How to show only the last two categories in a menu?
- Always hide a page from the menu
- remove different admin menu for specific users
- How to get an array out of a nav menu if it’s a plugin?
- Navigate to external link if last page or post in a category
- How can I add recent posts to menu like mashable
- What happens when you create/edit a menu
- Plugin admin list pages as submenu
- Adding parent custom post type menu option
- Create and style menu
- Change the class of wordpress menu
- How can I create a navigation menu in the sidebar that can also act like a slider?
- Invalid Menu Items
- Declaration of mandoe_menu_walker::start_el(&$output, $item, $depth, $args) must be compatible with Walker::start_el(…)
- Custom Nav Walker $item->url producing malformed hyperlinks
- Displaying an Uploaded Image as a Custom Avatar in WordPress
- What are the advantages to the Settings API?
- Show current navigation path from menu
- How to add menu support to a theme?
- How to create a plugin that only operates on the home page?
- Adding callback function for wp_ajax_ has no effect
- How to pass custom options from widget form to widget update callback?
- WordPress admin deleted user details not removed in database. How to delete WordPress Users from Database
- plugin development: storing language specific options
- Save Checkbox value in Plugin [duplicate]
- edit_{$taxonomy} | Hook
- Worpdress cannot create directory
- Using the default wordpress uploader inside plugin
- Alter post object before display
- How to localize admin.php only once
- How to query children by post name/slug
- Displaying “One Time” Notification in Plugins
- Is it the right way to add jquery and css in wordpress?
- Dynamically generate meta tags and titles for a wordpress page
- wp_list_pages Hierarchical Help
- How to avoid the and which added when custon menu widget is used
- Javascript Function Called Too Early in PHP Script
- Downloading File via headers doesnt work
- get the permalink error
- WordPress custom url without using any of the custom tags given
- How to call a plugin function from a page
- If user is logged-in display/hide widgets ( siteorigine) [closed]
- Javascript not being loaded only in custom taxonomy template
- Output sort number in wp menu list item?
- Object Oriented plugin, add action and variables
- Why user is added back in database after deletion?
- Check in walker if current page is descendant
- add_action priority and taxonomy used in plugin
- Customize Walker_nav_menu to show posts if item is category
- Tracing dashboard publish settings from input form in WordPress
- Post data in wp-admin to external database
- Images not displaying on live server
- redirect word-press page with page values
- Forcing the Uninstall Hook to fail
- How will i add an option under customizer the event calendar section?