• Hi there.

    I’m having trouble with a loop which has been on a blog of mine for a while. The loop has been working perfectly and now for no apparent reason, one of the posts has stopped displaying in this loop (there should be 2 altogether).

    I have done all the obvious things like making sure it’s actually published etc, adding a new post etc but have not managed to find the issue. I have also upgraded the WordPress system to the latest one and still cannot find the problem. The page exists when you go to the direct address, but does not display the posts on the following loop on a static page. Is there something in the following loop which has been ‘discontinued’ or something?

    <?php query_posts('showposts=5&category_name=Events&meta_key=Date&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); ?>
    
    <ul class="events_content">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li>
        <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
        <p><?php
    global $more;
    $more = 0;
    ?></p>
    
        <p><?php the_content('More information &raquo;'); ?></p>
        <p><?php $Date = get_post_meta($post->ID, 'Date', true);?><?php echo $Date;?></p>
    </li>
    <?php endwhile; else: ?>
    <li>Sorry, no upcoming events!</li>
    <?php endif; ?>
    </ul>
    <?php wp_reset_query(); ?>
Viewing 5 replies - 1 through 5 (of 5 total)
  • At the least, showposts should be posts_per_page

    Thread Starter jo6891

    (@jo6891)

    Thank you very much for your reply.

    I tried replacing that with posts_per_page however this has made no difference. Has this ever happened to anybody else before? As I say, it’s literally stopped working, and only recently, it worked perfectly fine before.

    I’m totally stumped!

    Haven’t heard that being a bug. Maybe a plugin causing the problem?

    Thread Starter jo6891

    (@jo6891)

    Thanks again for your response.

    The only plugins I have installed are as follows:

    Akismet version 2.4.0
    Hello Dolly 1.5.1
    Wordpress Database Backup Version 2.2.2

    Then paste the COMPLETE template in a pastebin such as wordpress.pastebin.com and report the link back here–maybe someone can spot the problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Loop only displaying one post when there should be two.’ is closed to new replies.