Forums Forums Search & Filter Pro Making the Image Thumbnail a hyperlink in results

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #203391

    How can we make the thumbnail images in search results hyperlink to the post or page?

    https://leasequery.com/resources/

    Could you direct me to the PHP file that I would need to change to edit the search-filter-result-item?

    Thank you!

    Trevor
    #203403

    You appear to be using our ‘Using a Shortcode’ display results method, but the results do not appear to be from our standard results.php file? Have you modified it already, as described here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/

    Your theme appears to be Divi, for which we have an integration guide. You can see this here (we do also have a beta addon for Divi, but it may not be fully ready for live use yet):

    https://support.searchandfilter.com/forums/topic/divi-and-sf/#post-127431

    Anonymous
    #203409

    Hey Trevor,

    Thanks for the quick reply. I double checked on our staging site and editing the results.php file is making changes to what displays on the page.

    How can I edit this block of code to make the image hyperlinked as well?

    <?php
    if ( has_post_thumbnail() ) {
    echo ‘<div class=”lq_thumbnail”>’;
    the_post_thumbnail(“small”);
    echo ‘</div>’;
    }
    ?>

    Trevor
    #203438

    Make it this instead:

    <?php if ( has_post_thumbnail() ) {?>
    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail("small");?></a>
    <?php }?>
    Anonymous
    #203493

    That did it, thank you!

Viewing 5 posts - 1 through 5 (of 5 total)