I want to make a list to get the most commented posts, but my problem is that I can not 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 homepage it works great, but on a specific page, such as a post, for example, this code only lists a single item, which is the one of the post in question.
I want to put this code in the footer, so that it always appears, regardless of which page the reader is on.
Thank you in advance!