Just use link_before
in your wp_nav_menu
$args
and add opening/closing span tags:
$args = [
'link_before' => '<span>',
/* Add closing </span> to link_after */
'link_after' => '</span><svg>...</svg>',
// Other args
];
Related Posts:
- How to add nav menu items to a specific position within a menu
- create filter in functions.php
- Replace a menu with widget or a custom template file programmatically
- How to add custom li item to wordpress menu
- Default Nav Highlight
- search form leads to 404
- Conditional custom menu?
- How to display an image before title text in menu items
- Header menu aligned right on all pages except for single-post page [closed]
- Function Reference for custom link in Admin Menu Management Page
- remove empty paragraphs from the_content?
- How to load scripts/styles specific for a page
- Child theme – Overriding ‘require_once’ in functions.php
- Removing default image size list in Media Box
- Using wp_get_nav_menu_items() to list children of children pages
- Hourly Routine Not Firing ( wp_schedule_event() )
- syntax for remove_filter in parent theme with class
- Custom menus displaying all pages instead of set pages
- which is the function that removes accented vowels?
- Override parent theme function that is not hooked or in the functions.php file
- Theme Demo in live Site
- Removing title from page
- Hide some items from Screen options in dashboard for products
- Editing or filtering the output of the Genesis navigation
- Replace Archive Widget Link Text
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Best way to programatically add “rel” attributes to page and post images
- Limit filter upgrader_post_install to a single plugin
- Remove function or filter
- CSS for menu item added via functions.php
- Adding multiple taxonomy filters to functions.php
- Replace menu links with # and add name to its li
- How can I change the do_action function in footer (copyright area)
- changing behaviour of get_search_form
- Make parent page only link to first subpage
- Translation of theme using child theme
- Only let plugin add actions to wp_head & wp_footer on single posts
- Hard-coding custom menu elements for menu manager
- Add data attribute to each li in menu
- WordPress website Rs changed to currency symbol
- How to fetch the name of the active menu?
- Functions in custom theme
- Filtering out the #more anchor link that gets produced by
- How can I add a filter for specific categories on functions.php?
- How to add custom JavaScript in functions?
- How would I go about replacing this function in my child theme located in inc/template-tags.php
- Retrieve a value from Yoast SEO to use to set a default twitter card image honoring overrides
- Filter an WordPress Function in (general-template.php)
- How do I hook into the container of wp_nav_menu?
- How can I add a class to a nav li depending on URL?
- Functions php shortcode for displaying main menu with no child items
- login_headertitle is deprecated since version 5.2.0
- Filter to wp_list_authors
- Different methods of adding menu support to custom theme
- Add Adsense code between job listings – wp job manager plugin
- Problem with images URL after filter applying
- remove_action not working, even after changing priority [duplicate]
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- Replace header image on all other pages but home – URL issue
- Add a class to post if it has been recently updated
- how to add_filter to non hook function
- How Can I add a menu to the theme from withen the function.php file
- define css class in functions.php
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- Astra theme – cannot set short product description under the product title (product name)
- how can I add filter in specfic field in my website?
- Customizing the wp_video_shortcode output with add_filter
- Overwrite text in a complicated filter hook
- Override category archive page title (not the head title)
- How to add HTML into error message
- Class parameter in get_avatar args doesn’t get added to output
- Removing comment lines from all enqueued js files using a filter function
- remove_filter function to unhook twentysixteen parent theme function
- only update titles of single posts
- OOP Switch statement with array as parameter
- How can I automatically delete comments that contain a URL?
- Appending „read more” to the excerpt conditionally
- function replace_text for entire page
- ACF Filter return value
- Graphic before title – Specific Category
- Regex works in regexr, but not if I filter content [closed]
- Getting back a blank WordPress site following functions code edit
- Insert menu into theme location depending on user logged in/out status
- us states dropdown function and echo in theme template files
- How to pass a variable from a template page to the child theme functions.php
- functions.php filters not applied in AJAX call
- Adding custom field in menu options [duplicate]
- Settings in functions.php used by a plugin
- Adding a filter with custom function to the menu / navigation
- Random text changing to weird icons in both admin & front end
- Register a widget area when a theme option has been saved?
- Can’t change excerpt length and more tag
- Additional Sidebar
- How do I get my nav menu to show sub pages?
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- Adding function to function.php error 505 [closed]
- My website is generating weired url parameters of paginated pages
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- How to add different menu items on different menus?
- How can I modify or filter this variable in an existing class? (Mai Theme)