Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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; ?>
</ul>

Of course there are posts with that tag.

share|improve this question

2 Answers 2

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":

http://wordpress.org/support/topic/tags-conflict

share|improve this answer

Your Answer

 
discard

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.