1
I’m wanting to make a list to get the most commented posts, but my problem is that I can’t call the right listing always, here’s the code:
<ul>
<?php
global $query_string;
query_posts($query_string.'&posts_per_page=-1, post_status=publish');
if (have_posts()): while (have_posts()): the_post();
$post_name = get_the_title();
$post_url = get_permalink();
?>
<li>
<a class="transition-2s" title="<?php $post_name; ?>" href="<?php $post_url; ?>" rel="bookmark">
<span class="reclink"><?php echo $post_name; ?></span>
</a>
</li>
<?php
endwhile;
endif;
wp_reset_query();
?>
</ul>
On the home page works very well, but on a specific page, such as a post for example, this code only lists a single item, which is the post in question.
I want to release this code in the footer, so that it always appears, regardless of the page the reader is.
Thank you in advance!
I understand, thank you for your help! You are right, I will have serious performance problems. I was trying to do a gambit, but it will end up being worse. My intention is only the most commented, but I use the comments of facebook as I asked in that post and told me that I would have to use the facebook API, but as I do not know, I was trying to get around, but it seems that it is more bad than good... Anyway, I really appreciate it!
– Luna Laura