Display Post from a Particular Category
-
I have a category called “Urgent Announcements.” The idea is to have posts in this category show up at the top of my index page. I have had success, thus far, in getting it to show the post title from the category. However, using <?php the_content(); ?> does not render the content of the post in that category, but the content of the whole blog.
Thus, how can I show the actual content of a post that resides in a given category. In case it would be useful, here is the snip of code I am using to call the Title:
<?php $postlist = get_posts('category=2&numberposts=5'); foreach ($postlist as $post) : ?> <div id=\"urgent-news\"> <a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a> </div> <?php endforeach; ?>What I want is the content from that category as well as the title.
Thanks for any help.
The topic ‘Display Post from a Particular Category’ is closed to new replies.