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?
- Programatically add options to “add new” custom field dropdown
- Excluding iPad from wp_is_mobile
- How can I get $id variable in widget’s form function?
- Use ‘add_theme_support’ instead of ‘add_custom_image_header’ In WordPress 3.4
- Replacing select2 in admin backend for all selects
- difference between add_object_page and add_menu_page
- How to hook into the quick edit action?
- I created a child theme and it doesn’t work for some of the css files
- Make WordPress size and name images for Retina.js
- How to programmatically set a menu to be the Primary Menu?
- Pinterest Integration Using functions.php
- Trying to inject twitter metadata into using wp_head action in functions.php – get_the_excerpt() returns null
- how to edit functions.php in a child theme
- Only display link to author social media when it exists [closed]
- Get current page_id before loop, in functions.php
- Menu fallback “menu_class” rendering a “div” instead of a “ul”
- Create single.php for specific tag by tag id or name
- function to erase swear words
- Using $themename Variables
- How to add a slide toggle to the Woocommerce-Layout__Activity-Panel area in the orders admin page
- How to auto refresh when user change postcode
- Add sequential number to a Gravityforms form
- wp-comment author- url +, email filter hook
- how can I just add to parent theme function(s) instead of redeclaring whole the function
- Remove echo from shortcode
- Why does re-using this function not work? [closed]
- using jQuery on only one page
- Setting a default text for excerpts of a particular category
- Possible to hook into Media Library preview File column and use a custom image?
- Woocommerce checkout field
- Warning: preg_match(): No ending delimiter ‘^’ found in
- How to display the_archive_title() and the_archive_description() – “weird” interaction
- Remove Jetpack infinite-wrap
- Create a Woocommerce product widget with category filter
- “options.php” not found
- Both the require and add_template_part function are not including the file
- WordPress dynamic AJAX query
- Function to echo (or display?) wordpress tags in the head section
- is_home() not working in functions.php file
- Check if a different page has any attached images
- Conditional custom menu?
- What function actually renders the wp_admin_bar ? How can I call it?
- Do I Need to Prefix Variables Inside Functions?
- Detect Ajax call inside pre_get_posts function
- Render page with specific id from functions.php
- Display Child Pages if no child Exists Display Siblings
- How to show ACF value under post/page title in wp-admin
- What is wp_get_post_tags for media tags?
- Filter works on last selection but no others
- get_current_user_id() always return 0 in if else statement
- How do i tweak my wp Post title base on category of the post
- Why isn’t comment validation working?
- Custom query for custom post type not getting correct post ID
- I’m creating a online store for my website, my aim is to add description to products in home page only how can i achieve it?
- Menu and category highlighting for a single post
- I need to ‘wp_dequeue_script’ and ‘styles’ and ADD a bunch of other css and js
- True email confirmation for registration (keeping unvalidated users from user table)
- Code I am placing in the wp_footer is going outside the entire HTML frame!
- How to use if (is_page_template (”))
- wordpress function through ajax not being called
- How to assign results to variables?
- Hide certain post types from editors
- Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
- How to mirror exactly the left admin menu on front end?
- Make a table out of meta box
- is_user_logged_in() isn’t working
- Comment turned Invisible
- /page/2/ redirect to 404