Hey there, I’m using a child of twenty eleven theme.
I want to change the way search.php is displaying search results.
Currently search.php displays search results as:
Post titles, along with a snippet of content for the post, and the continue reading link.
However, my site’s posts/content are structured like this:
Post name ‘A’
(This contains lots of variations of foods beginning with the letter A as H3 headings, along with a paragraph description about each)
Post name ‘B’
(This contains lots of variations of foods beginning with the letter B as H3 headings, along with a paragraph description about each)
etc…all the way up to Z.
When you use the search box to search the term ‘apple’ for example, the results display the post name ‘A’, along with a little bit of content and then the click to read more. If the visitors click to read more then they will still have to scroll through the long list of foods on the ‘A’ post to find the one they were searching for, so this beats the purpose of using the search box since they could have just clicked post ‘A’ instead of using the search box.
How can I modify search.php (within the child theme of course) to make it not display post titles, but instead display H3 headings which match the search term, and then this heading can also be the link to the post, which when clicked would need to bring you to the right position within the post where the relevant H3 heading is.
Edit: Or alternatively, how to modify the search.php file to make it not display post titles, but instead display H3 headings which match the search term, along with the paragraph of text for those H3 headings. (so basically if someone searches ‘apple’ then the results would show the heading ‘apple’ along with the description about apples, which are found within post A)
- The topic ‘[Theme: Twenty Eleven] – Change search results’ is closed to new replies.