WordPress.org

Ready to get started?Download WordPress

Forums

displaying full post in search results (6 posts)

  1. orangeena
    Member
    Posted 6 years ago #

    i am trying to get the full blog posts to show up in the search results page and also when you view the posts by category.

    Right now, it only shows the title and the first few lines of text. i'd like it to show the image and also a text field i have in each post as well. my posts are short, so showing the full post won't make the results/categeory pages too lengthy.

    can anyone help? I'm looking for the code. Also, I can't even tell which php page i need to add it to..

    thanks in advance.

  2. Chris_K
    Member
    Posted 6 years ago #

    Have a look at Template_Hierarchy and see what pages are used for search results.

    If you don't have a search.php in your current theme, you may wish to create one.

    If you have one but it is using the_excerpt() in The_Loop, you might change that to use the_content() instead.

  3. orangeena
    Member
    Posted 6 years ago #

    I do have a search.php file. i've been going through it and found this code that may be causing this:

    <div class="entry">
    <?php the_excerpt() ?>
    <p><a href="<?php the_permalink() ?>#more-<?php the_ID(); ?>" title="Read the rest of this entry">[Read more &rarr;]</a></p>

    i don't know what to change it to, though. any suggestions?
    thanks

  4. orangeena
    Member
    Posted 6 years ago #

    i just figured out how to fix my search results.

    i still can not get it set correctly when viewing by category.

  5. whooami
    Member
    Posted 6 years ago #

    i still can not get it set correctly when viewing by category.

    its done the same way, by using a custom category.php

  6. charissaproctor
    Member
    Posted 6 years ago #

    would you mind sharing how you figured out how to fix the search results? I changed my search.php file to the_content, however while the full post now shows up, there are duplicates of each post and they are not displayed in the formatted way, they are all over the place.
    Any insights?!

Topic Closed

This topic has been closed to new replies.

About this Topic