[Resolved] How to call up a post from a category (query_posts Categories)
I have a page template that calls up some code to go in an area of the page. I’ve been hacking away for hours and i’m stuck like a pig in mud 🙁 I’d like to display posts from a particular category and cannot for the life of me figure out how to do it. Any help? 🙂
The code below allows me to displays posts fine but i’d like to modify the query to get posts from a category, (i.e., news, updates, food, cats, etc) as currently it’s getting any new post.
<h2>News</h2> <?php query_posts(array('posts_per_page'=>1)); if (have_posts()) : while (have_posts()) : the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <?php include (TEMPLATEPATH . '/inc/meta.php' ); ?> <div class="entry"> <?php the_content(); ?> </div> <a class=readmore href="<?php the_permalink() ?>">> Read more</a> </div> <?php endwhile; ?> <?php else : ?> <h2>Not Found</h2> <?php endif; ?> </div>
- The topic ‘[Resolved] How to call up a post from a category (query_posts Categories)’ is closed to new replies.