Title: adding function in custom search
Last modified: August 24, 2016

---

# adding function in custom search

 *  Resolved [nemanja.radevic](https://wordpress.org/support/users/nemanjaradevic/)
 * (@nemanjaradevic)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/adding-function-in-custom-search/)
 * is there any other function that i could add to force the appearance of this 
   star rating ?
 * the one give doesn t work altough it work on auto mode it appears on other places
   on my site just not in search results
 * <?php if(function_exists(‘spr_show_rating’)){echo spr_show_rating();}?>
 * [https://wordpress.org/plugins/simple-rating/](https://wordpress.org/plugins/simple-rating/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Igor Yavych](https://wordpress.org/support/users/flyerua/)
 * (@flyerua)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/adding-function-in-custom-search/#post-5969706)
 * There is `spr_get_entry_rating($post_id, $echo)` which returns whole html block
   of rating for entry with supplied id.
 *  Thread Starter [nemanja.radevic](https://wordpress.org/support/users/nemanjaradevic/)
 * (@nemanjaradevic)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/adding-function-in-custom-search/#post-5969708)
    - </h3>
    -  <?php
       if ( has_post_thumbnail() ) { echo ‘<div class=”search-thumb”>’; the_post_thumbnail(“
      small”); echo ‘</div>’; } ?> **<?php spr_get_entry_rating($post_id, $echo);?
      >** <p><?php the_excerpt(); ?><p> <p><?php the_category(); ?><p> <p><?php 
      the_tags(); ?><p> <p><small><?php the_date(); ?></small><p>
    - it didn t work
    - [http://www.greekfilmania.com/greek-filmania-search-results/](http://www.greekfilmania.com/greek-filmania-search-results/)
    - Invalid Post ID was supplied
 *  Plugin Author [Igor Yavych](https://wordpress.org/support/users/flyerua/)
 * (@flyerua)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/adding-function-in-custom-search/#post-5969740)
 * Of course it didn’t work.
    `$post_id` is supposed to be replaced with ID of the
   post/page/whatever else you got. `$echo` is supposed to be replaced with true/
   false (false by default)
 *  Thread Starter [nemanja.radevic](https://wordpress.org/support/users/nemanjaradevic/)
 * (@nemanjaradevic)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/adding-function-in-custom-search/#post-5969753)
 * so basically this is the solution
 * <?php spr_get_entry_rating(get_the_ID(), true); ?>
    i used this to enter the 
   rating in the search and filter pro plugin results
 *  Plugin Author [Igor Yavych](https://wordpress.org/support/users/flyerua/)
 * (@flyerua)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/adding-function-in-custom-search/#post-5969780)
 * Yes, this is how you can do it within the loop

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘adding function in custom search’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-rating_010101.svg)
 * [Simple Rating](https://wordpress.org/plugins/simple-rating/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-rating/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-rating/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-rating/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-rating/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-rating/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Igor Yavych](https://wordpress.org/support/users/flyerua/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/adding-function-in-custom-search/#post-5969780)
 * Status: resolved