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 show related posts by detecting the current category?
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- How to get ID of the page included with get_page()?
- Posts vs Pages and categories
- How to Get Posts, Including Private Ones?
- How to dynamically parse and transform post/page content before displaying it?
- How to get subcategories from category slug?
- Remove current category from post but display all others
- How to make default “Privacy Policy Page” a normal page?
- How show categories in admin and get that selected to show posts in index
- Random posts from a pool of posts
- disable Tab post on nav-menus page (Admin)
- Showing categories and subcategories with posts
- Change default category when I publish a post
- Proper way of establishing custom landing pages in WordPress
- store posts_id of category into a varable?
- Conditional Tag for has post [closed]
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- Loop doesn’t exclude the specified category in home page
- is_page Funtion for Posts ?
- is_page() and is_page_template() not being differentiated
- Display posts of specific category term
- Widget that shows categories with posts numbers
- How to create a sub post?
- How to get post content from an array of ids?
- Admin – no Featured image choice in create new/page|post
- Post Image not displaying in category view
- How to detect when admin user is on the All Posts page?
- static landing page leading to author specific pages w/ “live” content
- Display Posts with template on a Page
- Number of displayed posts
- How do I show posts from another wordpress installation?
- Why posts array is empty?
- get posts from Custom Post Type & Category
- Category page when using static front page
- Total number of posts in query (category/tag/author/search results/main page…)
- Latest posts by category — how to exclude current post?
- Custom Permalink Structure for Pages & Posts
- Getting a “404 Not Found” error when “Preview Changes” is clicked
- Why won’t pagination work?
- How do I include the category next to the title of a post?
- Relative number of post in category
- WordPress Query Posts From Category Post on Static Page
- How to put page numbers with the next/previous on a post/category list?
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- How do you search for a post or page with a certain url on the WordPress admin panel?
- how to hide empty fields of post category description?
- How to add some html formated text to every new post in WordPress
- how can i display my posts alphabetically?
- Post Filtering by GET URL parameters
- if in category but only with post meta
- How to get post with associated categories and tags names instead of ids with rest api?
- Display a mixed list of posts and media
- Intercept page request and add value to it
- Migrate posts from category and sub-category via SQL