frescova
Member
Posted 3 years ago #
I have duplicated my home page and I'm using it as a page" template - basically I'm creating an alternate "home page" to display all of the posts that belong to a specific category.
Can someone point me in the right direction please?
Thanks in advance...
Have a page display posts only from one category
before the WP loop, which generally starts with
<?php if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
add this code
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("cat=1&paged=$paged"); ?>
change cat=1 to the cat ID of the cat you want on the page. To find the cat ID, go to the category maint screen - point at the name of the cat - look in the lower left corner at the browser's status line - you will see a URL - the cat ID is at the end of that URL.