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.


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.

| improve this answer | |

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


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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