You can use the following filter:
add_filter('wp_list_pages', 'foo_bar');
function foo_bar($html){
//Create a regex pattern to identify the LI element with preg_match
//Create another pattern to identify the class attr and alter it with preg_replace
return $html;
}
As I’m not familiar with the exact elements you are working with, I can’t write up a regex for you. In theory, following these steps should work for you.
Related Posts:
- When tax_query used, results disappear (0 =1 produced)
- WP_Query in functions.php
- 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
- Gravity Forms field entries into wp_query loop [closed]
- List child pages of specific page using shortcode
- list tags with count in author profile page
- wp_is_mobile dequeue not working
- 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?
- Having a Function Inside of the Loop
- Wp_query function to search from product_title ‘OR’ product tags name
- new_excerpt_more link not working properly
- Display tags that only appear in one category
- Custom Query Not Paginating
- Reset postdata not working on WP_Query in functions.php
- Wp-query Order By problem
- How is $current_page passed in woocommerce_account_orders function?
- Using depth=n in wp_list_pages
- Sort and display pages with specific custom field (not tag)
- Filter for replacing the WP_query object for a given category
- Create a CUstom Archive by Year, but just for a Single Category
- Updating custom query var with multiple values
- WP_Query for Attachments not working as expected
- query_vars treat as single var from URL
- Optimizing multiple WP_querys into one call?
- wp_list_pages change of children and anchor of parent
- Query is not work
- How to Delete Posts by title?
- Integrating custom API for post content into Admin interface & Public Website [closed]
- Insert image between X number of posts but on specific paginated pages?
- get last part of page url and add it as cat in wp_query
- the_password_form functions not working together
- Adding an option to a shortcode
- In jquery use php variable to execute an enqueued jquery file
- Function filter breaking tag archive menus
- Question about “wp_deregister_script()”
- Do not show on homepage functions.php code needed
- Turn get_posts as string into an array for use in theme admin options
- How do I call a function to use on a page?
- How to create a functions.php in child theme? [closed]
- Custom HTML markup
- wordpress get_post_meta give only first value
- Functions Error: Impacting Galleries
- Is there a way to direct unregistered user to registration page when click a link?
- How to use author meta in shortcode?
- Using multiple line variable inside a function?
- Auto log in hook is requiring a page refresh
- is there a way to remove featured image from blog page and single page
- Auto-Tweet if Type is ‘Status’ using OAuth
- Adding code using functions.php in child theme
- Testing for a shortcode using a function. 404 page throwing PHP Notice
- WordPress Migration error phpupdate_option is not a function
- Passing global variable from header.php to functions.php
- Replacing global wp_query
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 9967617 bytes) in …\wp-includes\functions.php
- What happens to the text in functions.php file outside of the php enclosure?
- How to hide image-url if no attachment?
- wordpress acts like functions.php doesn’t exist [closed]
- Infinite counting in WordPress
- Use a shortcode to display custom meta box contents
- javascript and css links not working on sever
- Missing argument for the function
- is_page() or is_single not working
- Tags break custom Excerpt function
- Enqueue script on every page except one
- Best way to handle lack of titles in microblogging
- New custom menu created. how to apply it?
- problem loading stylesheets to wp_head dynamically
- Numbering lines of code with the tag?
- functions.php and conditional tags
- Latest Foursquare Checkin function
- Dropline menus — seperators between children only?
- Echoing function into WordPress NextGen gallery
- Where to call my pagination function?
- How do I pull excerpts from pages?
- attachment page template? only show attachments for current post?
- Conditional statement not working in function
- Output loop to function return?
- Run a jquery script on on a certain template page
- get_post_meta() problem again
- Update users custom profile fields
- Get urls of images in a gallery?
- How to echo the value of an array element using a function via a shortcode
- How to stop media_sideload_image from running when deleting a post?
- Filter nav menu items HTML tags and wrap inner text with span
- I want to display latest post in marquee [closed]
- Add php code to wp_print_scripts?
- How to get an attachment id from a filename
- Get Comma Seperated Taxonomy Linked Terms and Last Child Separated By “&” Instead Of Comma
- Determine if, within a post, you are on page 2 or greater – WordPress documentation circular
- how to get the post ID from wp_insert_post
- How to cut off question mark in url with functions.php
- current_user_can comma list vs OR (||) list
- Unable to return values from function
- Possible to hook into Media Library preview File column and use a custom image?
- Extending a custom framework built into WordPress to automatically turn the ‘Search Engine Visibility’ setting ON / OFF, dependant on environment
- Function not working inside of a function in functions.php
- WordPress Excerpt – How to remove the first link using functions.php