WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
Post ratings percentage (3 posts)

  1. crazysurf123
    Member
    Posted 1 year ago #

    Hi, i hope i won't look like a noob, but here is my question :

    <?php
    // The Query
    $the_query = new WP_Query( 'cat=16' );
    // The Loop
    while ( $the_query->have_posts() ) :
    	$the_query->the_post();
    	echo get_the_ratings($post_ratings_percentage);
    	echo '<tr><td><a href=' . get_permalink() . '>' . get_the_title() . '</a></td>';
    	$args = array(
    	'post_type' => 'attachment',
    	'numberposts' => null,
    	'post_status' => null,
    	'post_parent' => $post->ID
    	);
    	$attachments = get_posts($args);
    	if ($attachments) {
    	echo '<td><a href="' . get_attachment_link($attachment->ID, true, true, true) . '"> Télécharger</td>';
    	}
    	else {
    	echo '<td> Pas de lien </td>';
    	}
    	echo '<td>' . get_the_ratings() . '';
    	echo '<center><div class="progresss-bar1 green1 glow1"><span1 style=width:90%></span1></div></center></td></tr>';
    
    ?>
    </div>
    <br>
    <?php
    
    endwhile;
    
    // Restore original Query & Post Data
    wp_reset_query();
    wp_reset_postdata();
    
    /* The 2nd Query (without global var) */
    $query2 = new WP_Query( $args2 );
    
    // The 2nd Loop
    while( $query2->have_posts() ):
    	$query2->next_post();
    	echo '<li>' . get_the_title( $query2->post->ID ) . '</li>';
    
    endwhile;
    
    // Restore original Query & Post Data
    wp_reset_query();
    wp_reset_postdata();
    
    ?>

    Here is my loop, and i put a 90% as the size of my span progress bar, i'd like to remplace it with somthing like : $post_ratings_percentage but i don't know how to call it in this loop.

    Thanks a lot.

    http://wordpress.org/extend/plugins/wp-postratings/

  2. crazysurf123
    Member
    Posted 1 year ago #

    If you need more info you can ask :) Thx a lot if someone can help me :)

  3. crazysurf123
    Member
    Posted 1 year ago #

    I finally find the solution if someone need it :)

    But it was pretty long to do :/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.