WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had this code running fine forever. Some days ago it just started outputting nothing (just the <ul></ul>). No errors in logs:

<ul style="margin-left:0">
<?php query_posts('tag=pp&showposts=4'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

                    <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>

<?php endwhile; ?>

Of course there are posts with that tag.

share|improve this question

You should not be using query_posts at all.

It should be noted that using this to replace the main query on a page can increase page loading times, in worst case scenarios more than doubling the amount of work needed or more. While easy to use, the function is also prone to confusion and problems later on. See the note further below on caveats for details.

http://codex.wordpress.org/Function_Reference/query_posts (emphasis mine)

Second, the showposts argument has long been deprecated.

Third, the tag argument is not listed as deprecated, the source appears to still respect the argument, and it works when I try it. Make sure that you are using the tag slug and the name. The two may not be the same.

share|improve this answer
Thanks! :-) I'll be using get_posts from now on! – MultiformeIngegno Nov 30 '13 at 13:28
up vote 0 down vote accepted

Turns out it was a problem of the plugin "The Events Calendar":


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.