• Hi there

    I wish to include a thumbnail image, taken from the post, when displaying the search results summaries.

    Ideally these will display in much the same way as the blog page itself for which I used the List Category Posts plug in – https://www.whileoutriding.com/proof/blog

    I’m also looking for the option of having the thumbnail display for Categories and Archive pages.

    I’m using the Twenty Twelve theme.

    Can anybody help at all – any feedback would be appreciated…

    thanks
    Kevin

Viewing 4 replies - 1 through 4 (of 4 total)
  • I would expect to see the ‘featured image’ aka post thumbnail above the post title in the search results and archives.

    have you edited content.php in any way?

    if so, please post the full code of that template; (please use the pastebin – https://codex.www.ads-software.com/Forum_Welcome#Posting_Code )

    if not, are you sure that your posts have a ‘featured image’?

    Thread Starter suddensway

    (@suddensway)

    Hi alchymyth

    Many thanks for your comments.

    No I’ve not edited the content.php file but didn’t realise you needed to set a featured image for it to appear. I set one for the latest post and it does display a large image. It’s a step in the right direction but what I’m really after is a thumbnail taken automatically from the post. In the same way the List Category Post plug in works.

    Another issue with the Featured image route is that it shows both that and all the other images when displaying the categories and Archive posts…

    Any thoughts?

    thanks

    a thumbnail taken automatically from the post

    consider to use the plugin https://www.ads-software.com/extend/plugins/get-the-image/

    if you do, you will need to edit content.php, and possibly add the plugin’s code just before this line:

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

    Thread Starter suddensway

    (@suddensway)

    Many thanks for that. I got that to work using the plug in and expanded it to just show excerpts for categories, archives etc by using:
    <?php if ( is_search() || is_archive() || is_author() || is_tag() || is_category() ) : ?>
    (line 33 of content.php)

    Excerpts are being shown, with thumbnails (although many are not showing as in proof mode many of the image urls are external but this will be amended when the site is launched). However, and here’s the BIG problem – none of the post content itself is being displayed when you go to view the full article, there’s just the comments etc!

    Any help is very welcome.

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding thumbnail to search results excerpt’ is closed to new replies.