-
AuthorSearch Results
-
January 23, 2020 at 1:55 pm #231924
In reply to: Display selected category in WordPress template
TrevorParticipantThe currently applied filters are accessible to PHP. You would need the help of a skilled third party PHP coder, I think.
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
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
January 17, 2020 at 1:46 pm #231454In reply to: Check events pagination page number
TrevorParticipantDoes it appear if you edit the template and add this code:
$sf_current_query = $searchandfilter->get(334)->current_query(); echo '<pre>'; print_r($sf_current_query->get_array()); echo '</pre>';
(this will print an array to the page)
January 9, 2020 at 7:18 pm #230524In reply to: Problems with filtering custom post types/taxonomies
AnonymousInactiveThank you very much for your help, we finally got the plugin working! There is one issue remaining: The meta data of each search result is not displayed. We try to achieve something similar to this: http://opendata.ffe.de/?s=Solar
This is our current draft: http://opendata.ffe.de/searchfilter-test/
Using a short JS script, we were able to display the button, the symbol next to the title as well as the link to the category. However, we have had some trouble accessing the metadata via PHP. We followed the approach described here (https://searchandfilter.com/documentation/accessing-search-data/) and here (https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/#post-169171), but the printed results array is empty. We already checked that our ID is correct. As described earlier, we are using Elementor Pro on our page.
global $searchandfilter;
$sf_current_query = $searchandfilter->get(362)->current_query()->get_array();
echo ‘',print_r($sf_current_query),'
‘;
How should we approach this?December 25, 2019 at 11:20 am #229851In reply to: Display Count of Filters Applied
TrevorParticipantNot from within the plugin settings, but the currently applied filter IS accessible to PHP. You would need the help of a skilled third part PHP coder, I think.
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
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
Please note that we are (officially) closed for weekends, Christmas Day and New Years Day and will be operating limited hours on weekdays in between. However, I will be here when I can.
December 18, 2019 at 10:16 am #229325In reply to: Date range picker for ACF field
TrevorParticipantOur plugin send a list of matching ID’s to the WordPress database, having worked out which posts match the criteria, the the actual final query may not be of much use. It will send a query to our cache tables though. Query Monitor plugin should show you that. To get a breakdown of the actual filters in use, this code (you need to change the ID in this code – 1234 – to that of your form) will dump the array to the screen:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(1234)->current_query()->get_array(); echo '<pre>',print_r($sf_current_query,true),'</pre>'; ?>
November 28, 2019 at 2:14 pm #227931
TrevorParticipantGenerally speaking, the theme (or, in this case, Elementor Pro) handles such things as page titles. Our plugin does not.
Elementor elements do not have the ability to fetch search filters from our plugin, but, using PHP, you might find a way to do this. Normally, if you intend to use Ajax to refresh the results, such PHP has to run inside the Ajax Container, but I do not think, with Elementor, you can access that part of their code, so you may need to forgo the use of Ajax (disable it) to refresh the results.
The coding is likely to be complex, but 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
October 7, 2019 at 3:15 pm #223002In reply to: Accessing the Search Data
TrevorParticipantTo 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
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
You could temporarily use this code in your results template to display the full filter array so that you can work out the exact array part that holds the data you want:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(1391)->current_query()->get_array(); echo '<pre>',print_r($sf_current_query,true),'</pre>'; ?>
Where the ID needs to match that of your form.
October 4, 2019 at 12:53 pm #222869In reply to: You searched for (including filters)?
TrevorParticipantTo 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
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
You could use this to display the filter array:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(1391)->current_query()->get_array(); echo '<pre>',print_r($sf_current_query,true),'</pre>'; ?>
Where the ID needs to match that of your form.
July 5, 2019 at 4:04 pm #215649
TrevorParticipantTo 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
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
You could use this to display the filter array:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(1391)->current_query()->get_array(); echo '<pre>',print_r($sf_current_query,true),'</pre>'; ?>
Where the ID needs to match that of your form.
July 1, 2019 at 8:43 am #215288In reply to: get selected value and show on page?
TrevorParticipantI am not sure if this is what you want. To show the filters, as I said, this requires 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 fetch other filter terms/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.
-
AuthorSearch Results