Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Display featured image of the blog on pressing enter or magnifying glass
This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko 3 weeks, 4 days ago.
- AuthorPosts
- March 2, 2023 at 4:41 pm #41601
I would like the code and where to implement it so that when searching for blog posts, the search result shows the featured image of the post along with the title, date, and author when the enter or search button is pressed. Thank you.
March 2, 2023 at 5:25 pm #41605Hi,
I recommend using the theme functions feature within the theme you are using. With that you can fetch the additional information (such as the featured image) parsed by Ajax Search Pro, and use it within the template, in the search results loop.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 3, 2023 at 6:36 pm #41622You cannot access this content.March 4, 2023 at 4:29 pm #41630That code returns the image field URL, not the HTML tag, so you will have to wrap it into an image tag, like:
Best,<img src="<?php the_asp_result_field('image'); ?>">
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 4, 2023 at 10:30 pm #41636I’m sorry but it’s still not working. Can you tell me where I’m going wrong? Thank you. I have attached an image.
Attachments:
You must be logged in to view attached files.March 5, 2023 at 12:53 pm #41638You might be editing the wrong file there, I don’t see any of this in the source code. The output structure is completely different.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 5, 2023 at 7:28 pm #41639Hi, can you tell me the file path or where to put this code? Thank you.
March 6, 2023 at 10:09 am #41642You may have to ask the theme author about that – it is usually different for each and every theme out there. Unfortunately there is no specific location. For basic themes it is the search.php file, but it can be within the archive templates, loop files or nearly anywhere.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 6, 2023 at 4:12 pm #41649Thank you very much. Is there any video or tutorial on how to set up a custom search results page? Thanks.
March 7, 2023 at 9:20 am #41653I don’t know if anything like that exists, because it depends on the theme structure. You can check the official WordPress documentation on it, but it is only a very basic tutorial for a specific basic theme.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.