Forums › Forums › Search & Filter Pro › Default Results
- This topic has 5 replies, 2 voices, and was last updated 3 years, 11 months ago by Trevor.
-
Anonymous(Private) December 19, 2020 at 9:23 am #270380
Hey I would like to customize the content that is being displayed at the very beginning (before using the filter). As for now it shows all entries, but I would like it to show a blog post instead. Is it possible to insert the blog post’s link somehow?
Thank you!
website: https://urban-digital.de/kommunale-digitalisierungsstrategien-uebersicht/
Trevor(Private) December 19, 2020 at 1:01 pm #270393Yes, that is possible. I see that you are using our Shortcode method …
… in which case you should follow the ‘guide to customising’:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
Once you have a copy of the
results.php
file in a search-filter sub-folder of your theme, you can edit that file, like this (leave the PHP comments at the top outside and before this code):global $searchandfilter;
$sf_current_query = $searchandfilter->get(10265)->current_query();
if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()==””)) {
// code to display the blog post here
} else {
// the current resuts.php code here
}Anonymous(Private) December 20, 2020 at 5:52 pm #270439Hi, thanks for answering my question but I did not quite get the code steps.
1. I created the folder.
2. I have a copy of the results.php file
3. How can I now make the following post to be shown as the starting page in my display of results-area?Anonymous(Private) December 21, 2020 at 1:34 pm #270510Sorry but I don’t understand your statement. In the above-mentioned post you provide me a link that doesn’t work (it shows “Page 404”). The only thing that I’m kindly asking for is that you let me know how I can show a post instead of all results at the beginning.
Trevor(Private) December 21, 2020 at 1:36 pm #270512I am sorry, this is the link:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
-
AuthorPosts