As you are using the Shortcode Display Results method, I think that part of the page is not controlled by the results.php file, but by your theme’s page.php file.
Did we previously discuss which Display Results Method to use, because the only one I could think would work would be the Post Type Archive method, assuming that is is searching only one Post Type and the taxonomies are not shared by other Post Types?
It would be necessary to sort the results first. However, you want something other than alphabetical or numerical, so first you must create a (maybe calculated) field that looks at the categories and assigns a number as the sort order, using javascript hooking into the WordPress save_post() function (and you would have to edit existing posts to add the data. A primary sort would be based on this in our ‘Posts’ tab, and then a secondary sort for how you want them sorted with the groups.
As you are using our shortcode method and therefore have already customised the results.php, you would need to code so that as it loops through the posts it checks the current category and correctly adds beginning and ending HTML and titles for each category group. Very customised, but possible.
AnonymousInactive
Hi,
I’m using S&F Pro to search through a custom post type consisting of events. Events have a date set through an ACF date type field. Results are displayed using a shortcode, and style is applied using a custom results.php located in /search-filter/.
Seaching and filtering work fine, but I can’t seem do to what I want with the default display of results (before using any kind of filter). I would like to display as default only future events, starting with the closest. Past events should remain accessible through search.
I tried :
– In Search & Filter > Posts : changing default order and/or secondary order but it doesn’t affect the way the results are displayed. Plus it doesn’t offer enough options anyway (hiding certain posts according to a certain criterion, here : past date).
– Making a custom query in /search-filter/results.php : the results are displayed correctly but the filters don’t work anymore (displays the same results)
How can I achieve what I’m looking for using your plugin ?
Thanks,
Pierre
If you are using the Shortcode display results method, you need to follow the guidance here:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results
… and edit the results.php file to remove what you don’t want.
I need to see the customised version of results.php that you are using. Is this possible to show me?
I have edited line 48 of your results.php file.
Why did you put that shortcode there?
If you are using the Shortcode display results method, you need to follow the guidance here:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results
… and edit the results.php file to remove what you don’t want.
As you are using the Shortcode display results method, you need to follow the guidance here:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results
… and edit the results.php file to remove what you don’t want.
In the settings for that field, can you screenshot what you have set and give me a link to see/download the image (you can’t upload them here, but any file sharing site will do)?
In that same file, results.php, you should see the <h2>tag. Simply change that to a diiferent tag, or add a class to it, e.g.
<h2 class=”myclass”>` and make some custom css for this (change the classname). It is possible you theme already has a suitable class for which CSS already exists.
Which of the Display results methods are you using, if it is the Shortcode method, you need to follow the guidance here:
as per this documentation:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results
and edit the results.php file to remove what you don’t want.