Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #164854

    Hello, great theme!

    Is there a way to show thumbnails (of post’s featured image) on search results page? I looked through the forum and was unable to find a clear answer.

    Regards

    #165009

    Hey rbellei!

    Thank you for using Enfold.

    You need to edit the includes > loop-search.php and look for this code:

    
    $post_format 	= get_post_format() ? get_post_format() : 'standard';
    

    Below that, add this line:

    
    $thumb = get_the_post_thumbnail(get_the_ID(), $avia_config['size']);
    

    Again, look for this line of code:

    
    echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";
    				//echo the post title
    

    .. then add this code below:

    
    echo "<div class='search-thumb'>".$thumb."</div>";
    

    After that, insert this css code in the General Styling > Quick CSS field.

    .search-thumb {
    	width: 300px;
    	height: 200px;
    	margin-bottom: 10px;
    }
    
    .search-thumb img {
    	width: 100%;
    	height: 100%;
    }

    Best regards,
    Ismael

    #165871

    It works!

    Thank you Ismael.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Thumbnails on search results page’ is closed to new replies.