Davebenroberts
Member
Posted 2 years ago #
I have a 6 page wordpress site, that I will have 6 different Categories of Posts. I need Category number one to show up on Page number one, Category number two to show up on page number two.
I'd like to be able to show the posts through the plug-in Visual Recent Posts
Any Information on this would help. I'm thinking possibly an If else statement?
Similar to:
`$body = 'b';
if (is_page('about')) {
$body = 'body-0';
} elseif (is_page('destinations')) {`
Thanks in Advance!
-Dave
Don't really know why you would need Pages to display a set of posts belonging to a category. The WordPress native archiving ability will handle that for you.
If you are using Pages because of a nav bar situation, then look at How to easily display links to both Pages and Categories in the blog navigation header?
Related:
Category Templates
<?php if ( is_page('page1') ) { ?>
<?php query_posts('category_name=page1'); ?>
<?php } ?>
<?php if ( is_page('page2') ) { ?>
<?php query_posts('category_name=page2'); ?>
<?php } ?>
<?php if ( is_page('page3') ) { ?>
<?php query_posts('category_name=page3'); ?>
<?php } ?>
<!-- start the loop -->
<?php while (have_posts()) : the_post(); ?>
<!-- your loop -->
<?php endwhile;?>