Display content of a post in the results page
-
Hello everyone, I am trying to modify the search results page of my website and could use some help with it.
When a user makes a search, the search results page shows the post (due tot he nature of my website, the search results page will always show only one post) that matches such search. Then, they can click on it and see its content.
I want the content of the post that appears in the search results page to be shown directly in the results page, so the user doesn’t have to click on the post in order to see it.
I tried modifying the search.php file:
while ( have_posts() ) :
the_post(); <—- Changed this line for this one: the_content();. It worked
but almost no styles were applied and the page was
infinite, like a loop.generate_do_template_part( ‘search’ );
endwhile;
Can someone help me with this?
Thanks you in advance
The page I need help with: [log in to see the link]
- The topic ‘Display content of a post in the results page’ is closed to new replies.