Display custom information in my search results
-
Hi, 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” and they pointed me this way. This is what I get:
———————————————-
Title (Clickable through to article)Picture
%Random snippet of text with highlighted words in% (via a plugin which will not work I’m informed)
———————————————-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’m using the Theme “Organic Farm”,
I would like to display the values of certain fields, and I have no idea where to view or configure displaying the custom fields that “WP Recipe Maker” would have made.
I have tried adding random snippets in this theme’s “search.php”, in the section
if ( have_posts() )
like:
*get_metadata( string $meta_type, int $object_id, string $meta_key = '', bool $single = false )
* get_metadata(‘wprm_nutrition_calories’)
* but I am not sure how to get the values would like and how to get the display I would like above.Is anyone able to assist me, please?
Kind regards
Adam
- The topic ‘Display custom information in my search results’ is closed to new replies.