Probably the get_posts tag. It’s simple, you just need a loop.
<?php
$args = array( 'numberposts' => 5, 'cat' => 5 );
$postslist = get_posts( $args );
foreach ($postslist as $post) : setup_postdata($post); ?>
<div>
<?php the_date(); ?>
<br />
<?php the_title(); ?>
<?php the_excerpt(); ?>
</div>
<?php endforeach; ?>
That will show the last 5 posts from the category with ID 5. Complete parameters list.
Related Posts:
- Get Posts Under Custom Taxonomy
- How to show related posts by category
- get_children() Not Working with orderby Parameter
- Query only Posts from Both of Two Category?
- is there a better way of combining this?
- Can I hide a specific post from latest posts page?
- How to show post(excerpt) from specific category on wp page?
- Posts are not showing up on particular category
- Can I divide the pages into categories?
- Get mixed category random posts
- Should I use posts or pages in this scenario?
- post categories
- Post categories to pages
- Get Posts Under Custom Taxonomy
- Get attachments for posts that belongs to a specific category
- How to get post with slug and exclude categories
- Having pages after specifying post_type post
- Are post, page and category IDs unique to each other?
- posts going to 2 pages/categories only show up in 1
- How can I add a page that shows posts from a single category?
- Different post views for different category views
- How to add content above footer in posts from specific category
- Automatic duplicate/copy of post to a related page in WordPress
- Yoast breadcrumb URL shows category instead of the page
- How to distinguish pages created by woocommerce?
- How to add a block to a category page?
- Page with Category Returning 1
- Post Category link is same with Page link
- How to Get Position of a Post from a category and tag
- How do I make it so that new posts within a certain category go into a certain page?
- Precedence of page permalinks over woocommerce product category links?
- Any difference betweenn posts and pages for one page?
- Show only top 3 posts from 3 categories in order on home page
- Retrieve latest post by multiple categories with ID
- Displaying only posts from a certain category on my custom page template
- I need to create a page or post hierarchy
- how to style an individual page in a category [duplicate]
- wordpress show category link instead of post link [closed]
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- wordpress category Description not allowed tag
- View post with specific category id and name which I selected in the backend (drop-down option)
- How to get the number of posts in a selected category?
- How to know if get_posts() failed?
- Show related posts by category but ignore one category
- Create custom page in WooCommerce
- eBooks download website, page or post?
- Hide add new page button
- How To Keep Posts from Being Displayed Two or More Times on My Homepage? [closed]
- Divide Loop Into Days & Categories
- Different template for posts of all subcategories of category
- Can I set and show “important” post in my blog?
- Mark menu item as current-menu-item for category
- How to set up multiple taxonomies for groups of posts
- How to display category from recent posts?
- How do I restart my loop with get_next_post()?
- How do I get blog posts to appear within CMS?
- Post page to display specific category
- how to show single post in a custom template
- Start post pagination at 0 instead of 1
- Excluding posts not working
- How to Get Posts, Including Private Ones?
- Remove current category from post but display all others
- Admin – no Featured image choice in create new/page|post
- Why won’t pagination work?
- How do I include the category next to the title of a post?
- Display a mixed list of posts and media
- Custom Articles page only showing a limited number of posts per page
- Make ‘blog’ page show content as well as posts underneath it
- Get x recent posts by author?
- Remove Featured Image from posts in specific category?
- Setting limit to posts or page creation
- post/page content
- Post in bulk based on category template
- Is there a way to categorize a list posts all at once?
- On the online version of my blog posts disappear
- Foreach issue in get_posts function
- Nestling Posts Under Page & Justify Text
- More Than 50K Categories and WordPress Admin Panel Stop Showing Categories and Posts
- Re-order Category Meta-data
- Creating a “category” of featured posts
- List Authors For Current Category
- List posts of assigned categories in list of all categories on single.php
- some posts being displayed as pages
- Assign specific ads to specific categories/posts
- find posts with exactly 3/4 categories
- Make Show Notes for Individual Podcast Episodes Easy to Find (multiple URL’s?)
- can’t post immediately
- Use radio buttons & checkboxes for post categories
- Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page
- not empty categories don’t show in menu [closed]
- List posts that are in the same category as the current post title
- Multiple blog “feeds” in a single blog each with distinctly styled post pages
- How to get pagination working with “Pending” Posts
- Custom post page has attributes of latest post [closed]
- Post’s arent displaying
- Show with echo if a post has two or more categories
- How to have 2 posting pages on a blog
- Sort Posts Alphabetically Based on Specific Category (Divi)
- I have a website issue I am trying to resolve
- How to sort posts alphabetically based on a specific parent category