Tagged: search results, taxonomies
- This topic has 6 replies, 2 voices, and was last updated 3 years, 10 months ago by
Joseph Barrett.
-
AuthorPosts
-
August 12, 2018 at 7:38 am #57823
Joseph Barrett
MemberOld version this function worked but something changed maybe you know off hand what needs to be updated to hide taxonomies on search results, is it not called ‘the_tax” any more?
12345678function gmw_remove_taxonomies_from_results( $tax_output, $gmw, $post, $taxonomy, $the_tax ) {$taxtypesnames = array("brands" , "sizes");if ( in_array($the_tax->name, $taxtypesnames) ) {$tax_output = "";}return $tax_output;}add_filter( "gmw_pt_results_taxonomy", "gmw_remove_taxonomies_from_results", 10, 5 );Thanks for looking
August 13, 2018 at 10:27 am #57827Eyal Fitoussi
MemberHello Joseph,
The taxonomy function was completely redone, that is why your script is no longer valid.
Try the below:
1234567function gmw_remove_taxonomies_from_results( $args ) {$args['exclude'] = 'brands,sizes';return $args;}add_filter( 'gmw_post_taxonomies_list_args', 'gmw_remove_taxonomies_from_results', 50 );Let me know it if works.
August 13, 2018 at 10:31 am #57829Joseph Barrett
MemberEXCELLENT, thank you.
On a side note, I noticed there are missing- tags in some of the search result templates. Should I dig in and give you specifics in a new thread?
August 13, 2018 at 10:33 am #57830Eyal Fitoussi
MemberYou are welcome.
No need to start a new topic, feel free to post the issue you described in this topic.
August 13, 2018 at 10:44 am #57833Joseph Barrett
MemberAlso, how to remove the number ” 1) ” added before the search results titles (.wppl-h2)?
It was a just missing
<ul>
before the<li>
for each results listing in the template files. i changed mine to use div’s instead of list items, worked well. I’ll get screen shots/file names when I get home later. Thanks again.August 13, 2018 at 10:56 am #57839Eyal Fitoussi
MemberThank you for pointing this out, Joseph. I do see the missing UL tags. There are DIV tags instead. I will fix this for the next release.
As for the location count, you simply need to remove the line
1echo $post->location_count; ?>)in your custom template file.
August 17, 2018 at 4:14 pm #57859Joseph Barrett
MemberThe function to exclude taxes didn’t work for me… any ideas or syntax errors? I din’t see a filter list in docs.
Last thing, in the search results taxonomies, any way to remove the link from tax names and just show text names?
-
AuthorPosts
You must be logged in to reply to this topic.