The PHP functions goes within the loop https://codex.wordpress.org/The_Loop because it really differs from theme to theme, I cannt be explict. You have to consult your theme author.
If you want to put the most rated post you have to put it in the single post template and use the PHP function and I already answered it in your http://wordpress.org/support/topic/most-rated-shortcode?replies=2. There is no shortcode for it.
Lester,
First of all thanks for your assistance. And sorry for the duplicate posts earlier. Had an issue with my browser.
I am frankly confused. I am looking for the php code:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
in the single.php file. It doesn’t exist in index.php either as instructed on the faq.
I am using wp 3.1.2 and using the twentyten theme.
I understand that once I find this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
I need to paste the php code as instructed on the faq for inserting most rated posts.
I understand that I could do this within a widget but this is not an option I want to use.
I’m hoping to insert it directly after the [ratings] shortcode in the post.
More guidance please?
Lester,
Thanks, that works.
I have updated my single-loop.php by placing the php function for highest rated posts.
However this line:
Default: get_most_rated(‘post’, 0, 3)
is being echoed out into the post. I can’t understand why and I assume I need that part of the code so it knows about the 0 and 3 value on displaying the posts.
I copied exactly as it was in your faq page.
What am I doing wrong? Paste the code I need to use please?
Thanks.
Try this as stated in the FAQ “Use” block
<?php if (function_exists('get_most_rated')): ?>
<ul>
<?php get_most_rated('post', 0, 3); ?>
</ul>
<?php endif; ?>
Lester,
Thanks. This works.
One final question if I could…
How could I add a title to that block of code you provided so it gives the top three highest scored posts a title?
Something like “Check out these other posts and vote!”
Then underneath are the three posts
Thanks for your patience and help. 🙂
Just add <?php echo 'Check out these other posts and vote!'; ?>
before that block of code?