Support » Themes and Templates » [Resolved] Search results only displays full post

[Resolved] Search results only displays full post

  • Hi all,

    I’m having an issue where my search results are only displaying a ‘full post’.

    This would be ok but unfortunately I’m using a table plugin to create sortable jquery tables on some pages & posts, and when displaying results it strips out all the formatting and making it look terrible

    See my test site for example.

    Under settings I have checked the box for excerpts, but no joy!

    Any help much appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Anthony Hortin


    You have two options here. The first option is to simply insert a ‘More tag’ into your content by clicking the ‘Insert More Tag’ button on the Editor Toolbar. When you insert a “More” tag into your Post/Page, everything prior to the tag is considered as a ‘teaser’ and so you wont get the full content displaying.

    Alternatively, override the content.php file in your child theme by making a copy of this file and then changing the section that displays the search results. Instead of using the_content(), change this to use the_excerpt().

    Got it!

    The comment on the 1st line confused me:

    <?php if ( is_search() ) { // Only display Excerpts for Search ?>

    But i’ve swapped out the_content for the_excerpt and it’s fine now.

    Didn’t want to use the ‘more’ tag because I am using custom excerpts.

    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Search results only displays full post’ is closed to new replies.