I am planning to use conditional tags and query posts to have pages that display certain categories from my blog. I have accomplised that, but currently the text from the page it self is no longer displaying on the page.
For example, I created a page called News. In the admin section when writing the new page I typed that this page would be used to show current news articles. In the page template I use conditional statements to say that if this is page 14 (the news page) then display entries from the news category I created (cat 6). This works, but the text that I typed in for the page no longer displays. I assume this is the fault of my conditional query post, as pages that aren't affected by the if statement still show the page content. What do I need to do to fix this?
Here's my page code. thanks for any help or suggestions!
<?php get_header(); ?>
<?php include(TEMPLATEPATH."/sidebar1.php");?>
<div id="main">
<div id="content">
<?php
if (is_page('6')) {
query_posts('cat=3');
}
?>
<?php
if (is_page('14')) {
query_posts('cat=6');
}
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div class="entrytext">
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
</div>
</div>
<?php include(TEMPLATEPATH."/sidebar2.php");?>
<?php get_footer(); ?>