• Resolved nemanja.radevic

    (@nemanjaradevic)


    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://ww.wp.xz.cn/plugins/simple-rating/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Igor Yavych

    (@flyerua)

    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

    (@nemanjaradevic)

    • <h3>“><?php the_title(); ?></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/

      Invalid Post ID was supplied

    Plugin Author Igor Yavych

    (@flyerua)

    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

    (@nemanjaradevic)

    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

    (@flyerua)

    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.