Forums › Forums › Search & Filter Pro › Two identical taxonomies are displayed
- This topic has 7 replies, 3 voices, and was last updated 6 years, 7 months ago by Anonymous.
-
Ross Moderator(Private) April 10, 2018 at 10:28 pm #171379
Hi there
I figured the solution.
Your theme has this function
_st_list_categories_without_title
, which, it seems to (unintentionally perhaps) filter every singlewp_list_categories
I don’t understand the logic of the function, but they seem to destroy and recreate the taxonomy list for perhaps a particular style of formatting.
Anyway, we use that function in our plugin, and it caused some errors because we use the
walker
argument withwp_list_categories
.I managed to figure a workaround though, which is to remove the walker setting from your themes
_st_list_categories_without_title
function.You can override their function (and use my modification) by adding this to your child theme-
function _st_list_categories_without_title( $output, $args ) { $defaults = array( 'echo' => 0, 'use_desc_for_title' => 0, ); $r = wp_parse_args( $args, $defaults ); $r['use_desc_for_title'] = 0; $r['echo'] = 0; $r['walker'] = ''; //this is the only change I made remove_filter( 'wp_list_categories', __FUNCTION__, 11 ); $output = wp_list_categories( $r ); add_filter( 'wp_list_categories', '_st_list_categories_without_title', 11, 2 ); return $output; }
I’m not sure if it will have unintended consequences in your theme though (and I’m sure this filter needs to be applied conditionally rather than globally), so it would be best to direct your theme author to this post – I would be happy to discuss with them this code and my suggestion.
Thanks
-
AuthorPosts