• Hi, this is my first post and I’m brand new to WordPress so I apologies in advance if this is a basic question.

    I have WordPress installed on my local network so I search via a WordPress search page and not on the internet, but how can I get the results of my search to display the information I want, please?

    For example, I’m making a recipe book/card local site with the Free “WP Recipe Maker” so I can use it as my personal recipe book with different recipes I enjoy to eat. I try to search using the Free Relevanssi which seems to find the pages I require (Title, Picture and some text) but I would it to display specific text that I enter in to “WP Recipe Maker”. This is what I get:
    ———————————————-
    Title (Clickable through to article)

    Picture

    %Random snippet of text with highlighted words in%
    ———————————————-

    But if possible I would like the search to display results like:
    ———————————————-
    Title (Clickable through to article)

    Picture (Clickable through to article)

    Calories: %meta_value%
    Time: %meta_value%
    Servings: %meta_value%
    Cost: %meta_value%
    ———————————————-

    I’ve tried using “Use custom fields for excerpts” and even looked at “Breakdown of search hits in excerpts”, but it’s not the number of hits I would like, it’s the values I would like back of certain fields, and I have no idea where to configure displaying the custom fields that “WP Recipe Maker” would have made.

    Is this possible with my current setup? If so how would I achieve this? Please bear with me and my lack of experience with this.

    Kind regards
    Adam

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    What you want has nothing to do with Relevanssi. Relevanssi can’t do that for you. Relevanssi is pretty much responsible for finding the posts, how they look like on the search results page is up to your theme.

    You need to edit the search results template in your theme so that the search results page displays the posts as you wish.

    There’s a search results template in your theme, likely the file search.php, which is in control of the search results. It may print out the posts by itself, or it may delegate the printing out of individual posts to a template part, like content-post.php. The exact details depend on your theme.

    Theme basics from the WP documentation is a good place to start. Understanding the Loop is critical.

    I would recommend asking further questions either on the support forums of your theme or on the Developing with WP forums, you’ll find more people there, and not just me.

Viewing 1 replies (of 1 total)
  • The topic ‘Display custom information in my search results’ is closed to new replies.