Forums › Forums › Search & Filter Pro › Display selected filters
- This topic has 10 replies, 2 voices, and was last updated 5 years, 7 months ago by Trevor.
-
Anonymous(Private) April 25, 2019 at 1:49 pm #209303
Hello! Can i display selected filters in custom block? Out of shortcode? https://prnt.sc/ngqbtd
Trevor(Private) April 25, 2019 at 2:07 pm #209306It would require custom coding when using the current version of Search & Filter Pro. You can access the filter terms though, but would need further PHP work to display them. To fetch the search terms, the https://searchandfilter.com/documentation/accessing-search-data/ guide is basic but you can extend the idea to grab lots of other data. If you have other filters, then it becomes a little more complex, but I can give you links. This thread might help you:
https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/
… and this search will give similar threads I think:
https://support.searchandfilter.com/forums/search/sf_current_query+get_array+field+%5Bvalue%5D/
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
Anonymous(Private) April 26, 2019 at 6:50 am #209381Ok, thank you! I think about it. I have one more question: I use Post Views Counter Plugin, and when i place
pvc_post_views();
function inside results.php template (address:/wp-content/themes/mytheme/search-filter/results.php) My filtering results are crashing (display nothing), when i click on filter buttons. What i need to do?Trevor(Private) April 26, 2019 at 11:29 am #209419You want to display the number of post views for each result?
This documentation page:
https://dfactory.eu/docs/post-views-counter/developers-api/
Suggests that the
pvc_post_views()
function is to be used like this:pvc_post_views( get_the_ID(), 1 );
-
AuthorPosts