• Resolved gadgeteffect

    (@gadgeteffect)


    Hi there,

    I’m trying to make a page (different from my other post) to show all of the posts in that category as well as having some static content. The static content will be on top (or I’ll just make a post and make it a sticky). But what’s happening is that the only post is loading 10’s of 100’s of times and I only need it to load once. I think the loop is messed up but I don’t know how to fix it. Could anyone help me? Here is the code.

    <?php
    /*
    Template Name: janky
    */
    ?>

    <?php get_header(); ?>

    <div id=”content”>

    <?php include(‘picturearea.php’) ?>

    <?php if (have_posts()) : ?>
    <?php $count = 2 ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php query_posts(“cat=janky”); ?>

    <h1><?php the_title(); ?></h1>

    <div id=”entry”>

    <?php the_content(); ?>
    </div>

    <?php endwhile; ?>

    <div id=”navigation”>
    <div id=”alignleft”><?php next_posts_link(‘« Previous Entries’) ?></div>
    <div id=”alignright”><?php previous_posts_link(‘Next Entries »’) ?></div>
    </div>

    </div> <!– content –>

    <?php else : ?>

    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>

    <?php endif; ?>

    <?php get_footer(); ?>

    Any help would be appreciated, thank you.

Viewing 1 replies (of 1 total)
  • Thread Starter gadgeteffect

    (@gadgeteffect)

    I figured it out!

    <?php query_posts(“category_name=janky”); ?>
    <?php while (have_posts()) : the_post(); ?>

    All I had to do was that!

Viewing 1 replies (of 1 total)

The topic ‘One post loading over nad over again’ is closed to new replies.