Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29848
    Sevian
    Member

    Hello again. when I use the search field, I would like to leave the post of result images. is it possible?

    Thanks

    #29924
    Sakin
    Keymaster

    @Sevian: Sorry I don’t get it what you mean? Can you post in your Site URL and explain.

    #30023
    Sevian
    Member

    pardon my English I’m using translate.google.

    When looking for a post in the search box. I get no pictures in the post. May appear with the post thumbnail.

    https://dl.dropboxusercontent.com/u/10776731/Captura.JPG

    thanks

    #30119
    Sakin
    Keymaster

    @Sevian: Oh so you want to add Featured Image in your Search result posts. This is quite technical task.
    1. First you need to build child theme
    2. Then copy content-single.php in your child theme and find the following code in this file

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

    3. then replace the above code with the following:

    if ( is_search() ) : ?>
    <div class="entry-summary">
        <?php if( has_post_thumbnail() ):?>
            <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catchevolution' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
                <?php the_post_thumbnail( $imagesize ); ?>
            </a>
        <?php endif; ?>
        <?php the_excerpt(); ?>
    </div><!-- .entry-summary -->
    #30291
    Sevian
    Member

    thanks I’ll try

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Search Result with images’ is closed to new replies.