Forums › Forums › Search & Filter Pro › How to get slug from S&F current_query() selected taxonomy?
- This topic has 3 replies, 2 voices, and was last updated 5 years, 8 months ago by
Trevor.
-
Anonymous(Private) February 1, 2021 at 12:18 pm #274754
Hi,
I have managed to return the selected taxonomy string when I filter the posts. I would like to know how can I return the slug also?
My code:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(909)->current_query(); $sf_args = array( "str" => '%2$s', "delim" => array(", ", " - "), "field_delim" => ', ', "show_all_if_empty" => false ); $current_selected_taxonomy = $sf_current_query->get_field_string("_sft_thema", $sf_args); ?> <?= $current_selected_taxonomy ?>Thanks!
Trevor(Private) February 1, 2021 at 2:12 pm #274777I am not sure I understand. Can you give me an example URL with query strings, and explain what part of that you are trying to fetch, and what you need to do with it?
If this helps, details of the search filters set/chosen can be found, but it requires some detective work (specific to your form) and then some coding.
See this post:
https://support.searchandfilter.com/forums/topic/display-list-of-filters-currently-set/#post-264202
Anonymous(Private) February 1, 2021 at 2:17 pm #274780Found it here: https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/
Thanks
-
AuthorPosts