This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #41601
    quimquim
    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 MarcinkoErnest 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.

    #41622
    quimquim
    Participant

    You cannot access this content.

    #41630
    Ernest MarcinkoErnest 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'); ?>">

    #41636
    quimquim
    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.

    #41638
    Ernest MarcinkoErnest 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.

    #41639
    quimquim
    Participant

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

    #41642
    Ernest MarcinkoErnest 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.

    #41649
    quimquim
    Participant

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

    #41653
    Ernest MarcinkoErnest 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.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.