Forums › Forums › Search & Filter Pro › Hide excerpt on search result page
- This topic has 7 replies, 2 voices, and was last updated 6 years, 6 months ago by
Trevor.
-
Anonymous(Private) September 24, 2019 at 8:55 am #221728
Hi guys
For a page such as /search/?_sf_s=iphone my goal is to hide the excerpt for all the search results. I would like to show the title there only.
Which file do I have to edit in order to achieve this?
Thanks a lot and best regards
MichaelTrevor(Private) September 25, 2019 at 11:46 am #221857As an aside, that form has two search boxes, which is not permitted (or at least, will not work to combine them).
However, the form uses the ‘As an Archive’ Display Results Method, and you will (should) have specified a theme template file to use to display the results.
You will need to edit that template file (taking care to use a child theme, copy the file to the child theme folder, rename it, tell our form the new filename) so that it doesn’t output the excerpt.
Anonymous(Private) September 25, 2019 at 11:50 am #221861I know that multiple fields of the same type are not a good idea (will be fixed soon).
Is having a specific theme template the only solution to this?
It sounds quite complicated to me.Could you please walk me through and provide some more details on how to do it?
I always very careful before editing theme files, however, a child theme is already in place.Trevor(Private) September 25, 2019 at 11:54 am #221865Generally, a template has to be used to display results. If you don’t want to edit a theme template, you would need to use our Shortcode display method. The guide for customization is here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
You need to find this line:
<p><br /><?php the_excerpt(); ?></p>and remove it, along with the other parts you do not need.
You can edit pretty much anything in this file, but make small changes and test.
-
AuthorPosts