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

Reply To: Show rating in search results

#14410
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Jaime,

..It is not a custom field which the user enters but more the score that different users give to a certain post (like reviews of a certain item?) I would like to show that score on the description text..

From the code you are trying to use just actually gets the value of the rating, nothing else. The get_post_meta() function is to get a custom field value.

However, from the screenshot, I see you have an error there. You cannot use any PHP code within those fields, so the line, where the rating is, should look like this:

[php][<p><strong>Rating: {ratings_average}</strong></p>][/php]

..and it will print out the numeric value of the rating. Ajax Search Pro will automatically call the get_post_meta() function for the field within the {..} brackets.