Forums Forums Search & Filter Pro Sort Results by star rating

Viewing 10 posts - 11 through 20 (of 36 total)
  • Trevor
    #70430
    This reply has been marked as private.
    Anonymous
    #70439
    This reply has been marked as private.
    Trevor
    #70517

    OK. I looked at the form ID 261) called Search Form.

    First looks:

    Number of Results per page. In WordPress, use -1 to specify unlimited 😉

    I added a Post Meta to the page to see if it I could find the ratings fields in the meta keys list. In the Options I changed Get Options to Manual Entry and then clicked Browse Values. This lets you see what is there 😉

    It shows only two possible values; 5 and 0. Is this correct?

    I will leave that field there for now for you to look at.

    Anonymous
    #70522
    This reply has been marked as private.
    Trevor
    #70536
    This reply has been marked as private.
    Anonymous
    #70542
    This reply has been marked as private.
    Trevor
    #70547
    This reply has been marked as private.
    Anonymous
    #70676
    This reply has been marked as private.
    Anonymous
    #70756

    Thanks for all the help Trevor, sorry to come back to you so quick but the code added in the results.php has just come up with ‘Array’ rather than the star rating?

    while ($query->have_posts())
    {
    $query->the_post();

    ?>
    <div>
    <h2>“><?php the_title(); ?></h2>

    <p><br /><?php the_excerpt(); ?></p>
    <?php
    if ( has_post_thumbnail() ) {
    echo ‘<p>’;
    the_post_thumbnail(“small”);
    echo ‘</p>’;
    }
    ?>
    <p><?php echo get_post_meta( get_the_ID(), ‘ratings_average’ ); ?></p>
    <p></p>
    <p><small></small></p>

    </div>

    <hr />
    <?php

    Anonymous
    #70783

    Managed to get it to show the number by adding true after the code…

    while ($query->have_posts())
    {
    $query->the_post();
    
    ?>
    <div>
    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></h3>
    <p><br /><?php the_excerpt(); ?></p>
    <?php
    if ( has_post_thumbnail() ) {
    echo '<p>';
    the_post_thumbnail("small");
    echo '</p>';
    }
    ?>
    <h6>Average Rating: <?php echo get_post_meta( get_the_ID(), 'ratings_average', true ); ?> Stars</h6>
    <p></p>
    <p><small></small></p>
    
    </div>
    
    <hr />
    <?php

    And I have added some text. It doesn’t actually show the 5 stars, that would be better if you know how to do that as in your example websites. At the moment it shows Average Rating: 5 Stars for example, just in text.

    Alex

Viewing 10 posts - 11 through 20 (of 36 total)