Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11482
    Trishah
    Member

    I have tried to add a call for the thumbnail to the content.php in theif ( is_search() ) section but the thumbnail still isn’t showing in the search results.

    		if ( is_search() ) : // Only display Excerpts for Search ?>
                <div class="entry-summary">
                    <?php the_post_thumbnail('thumbnail'); ?>
                    <?php the_excerpt(); ?>
                </div><!-- .entry-summary -->

    I also tried to remove this section but that doesn’t work either.

    How do I get the thumbnail to show in the search results?

    #11490
    Sakin
    Keymaster

    @Trishah: Can you send me your site URL? I need to check in your site and see which theme are you using it.

    #11500
    Trishah
    Member

    ugh. Sorry, I should have told you that. I am using a child theme for CatchBox. My development install can be found here: http://trishah.com/clients/sofia/site/

    #11532
    Sakin
    Keymaster

    @Trishah: You code looks like just replace that
    <?php the_post_thumbnail('thumbnail'); ?> with

    <?php if( has_post_thumbnail() ):?>
    	<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catchbox' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
    		<?php the_post_thumbnail('featured-slider'); ?>
    	</a>
    <?php endif; ?>

    then you need to check in those post has featured image or not. If those post don’t have featured image then it will not display the image. See this for featured image http://en.support.wordpress.com/featured-images/#setting-a-featured-image

    #11575
    Trishah
    Member

    Yes, that is the answer. Thank you very much Sakin!

    BTW, I simply love the CatchBox theme. Once I understood it’s structure it makes it relatively simple to create responsive websites. 😀

    #11588
    Sakin
    Keymaster

    @Trishah: thanks for your appreciation.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘add thumbnail to serach results’ is closed to new replies.