I would like to have only a part of the post text as a search result and not the entire post. How do I set that?
My theme has a searchform php file and I am currently using the Search Reloaded plugin on WP 2.1.1. The search is in the sidebar but it is not a Widget.
?
The 'search.php' template file is where the results of searches are displayed. Customize that file to change how the search results look.
Take a look at your theme's search.php file. Chances are it's displaying the text of your post using the the_content function. Change it to use the the_excerpt function.
Details here: Template_Tags/the_excerpt
Hope this helps,
-drmike
This explains why I couldn't find any code for it. I don't actually have a search.php file! Guess I'll have to steal one from the default theme and see how that works. (I wonder where it went though. I'm sure there was one before)
Thanks a lot guys!
You can just copy the index.php file into a search.php file, then modify it as you see fit. All templates are similar in design, the only reason you would have a search.php is because you customized it.
Thanks Otto. Everything is starting to make more sense now.
I got it to work just fine so now I'm happy.
Thanks again everyone!