A looping question — query posts
-
This is my first time at WordPress and I’m using it to build a website (not a blog)…please don’t flame me for improper usage : )
I’m using the query_post(category) to display my dynamic content. I’ve got two seperate div’s, each with a query for a separate category. I’ve got it done and it’s working, but I read that “Use of query_posts on Loops other than the main one can result in your main Loop becoming incorrect and possibly displaying things that you were not expecting.” This would be bad.
Am I doing this?
<div id=”title”>Otsego Chamber of Commerce</div>
<div id=”content”>
<div id=”news”>
<?php query_posts(‘category_name=News’);?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>
<?php the_content();?>
<?php endwhile; else:?>
<p> nothing doing</p>
<?php endif; ?>
<?php wp_reset_query(); ?>
</div><div id=”chamberInfo”>
<?php query_posts(‘category_name=Chamber Info’);?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>
<?php the_content();?>
<?php endwhile; else:?>
<p> nothing doing</p>
<?php endif; ?>
<?php wp_reset_query(); ?>
</div>
</div>
The topic ‘A looping question — query posts’ is closed to new replies.