• Resolved tjobbe

    (@tjobbe)


    How do you add images to the search results page? I have a custom field named “Image” and I’d like to use the thumbnail from that if possible how would I do that?

    Also, On my category page, no image is displayed, how would I go about adding the same custom image field there?

Viewing 1 replies (of 1 total)
  • On your template file that is being used for your category and search results add the code below where you want the image to appear – replacing key with the key of your image.

    <?php echo get_post_meta($post->ID, "key", true); ?>

    You may need to style it with CSS. If you have a category.php page then that will be the one to edit to change how your category pages look and if you have a search.php page that change that to change the search results page. If you have neither then create them using index.php’s code, and adding the above to the new file.

Viewing 1 replies (of 1 total)
  • The topic ‘Images on search page’ is closed to new replies.