Display category posts on a wp page
-
Hi
I’m trying to display a list of posts from a specific category on one page. I have created a new template by duplicating and renaming the page_blog.php file so that the posts are displyed in the same format and I have linked the page to the new template. I am now trying to only display posts from one category on this page but I’m not sure how to do this. Can someone help?
Thanks<?php /* Template Name: Dropout Blog */ ?> <?php get_header(); ?> <div id="content"> <div id="contentleft"> <div class="postarea"> <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=" .st_option('blog_cat'). "&showposts=" .st_option('blog_cat_num'). "&paged=$paged"); while ( have_posts() ) : the_post() ?> <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <div class="postauthor"> <p><?php _e("Posted by", 'structuretheme'); ?> <?php the_author_posts_link(); ?> on <?php the_time('F j, Y'); ?> · <a href="<?php the_permalink(); ?>#comments"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a> <?php edit_post_link('(Edit)', '', ''); ?></p> </div> <!--The blog page is currently using the Limit Post funtion and is currently set to display 450 characters. You can increase or decrease it as you wish.--> <?php the_content_limit(450, "Read More"); ?><div style="clear:both;"></div> <div class="postmeta"> <p><?php _e("Filed under", 'structuretheme'); ?> <?php the_category(', ') ?> · <?php _e("Tagged with", 'structuretheme'); ?> <?php the_tags('') ?></p> </div> <?php endwhile; ?> <div id="prevLink"><p><?php previous_posts_link(); ?></p></div> <div id="nextLink"><p><?php next_posts_link(); ?></p></div> </div> </div> <?php include(TEMPLATEPATH."/sidebar_right.php");?> </div> <!-- The main column ends --> <?php get_footer(); ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Display category posts on a wp page’ is closed to new replies.