Display featured image of the blog on pressing enter or magnifying glass

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 Ernest Marcinko 1 year, 4 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #41601
    quim
    quim
    Participant

    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.

    #41605
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #41622
    quim
    quim
    Participant
    You cannot access this content.
    #41630
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That code returns the image field URL, not the HTML tag, so you will have to wrap it into an image tag, like:

    <img src="<?php the_asp_result_field('image'); ?>">

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #41636
    quim
    quim
    Participant

    I’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.
    #41638
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You 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 :)


    #41639
    quim
    quim
    Participant

    Hi, can you tell me the file path or where to put this code? Thank you.

    #41642
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You 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 :)


    #41649
    quim
    quim
    Participant

    Thank you very much. Is there any video or tutorial on how to set up a custom search results page? Thanks.

    #41653
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I 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 :)


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

You must be logged in to reply to this topic.