WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP timeout on the_loop (2 posts)

  1. djspark
    Member
    Posted 8 years ago #

    <?php while (have_posts()) : if(in_category(2)) : the_post(); ?>
    test<br/>
    <?php endif;endwhile; ?>

    on a clean install, default template, just added these, to start modifying kubrick template... WP timed out. But without "if(in_category(2)) : " , it went really fast...
    i tried this , and worked seamlessly:
    <?php query_posts('category_name=special_cat&showposts=10'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <!-- Do special_cat stuff... -->
    <?php endwhile;?>

    anyone else saw this behaviour ? should I report it as a bug ?

  2. Joshua Sigar
    Member
    Posted 8 years ago #

    Possibly because you do it in the wrong order. Try the following.

    <?php while (have_posts()) : the_post();
    if(in_category(2)) : ?>
    test<br/>
    <?php endif;endwhile; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic