That’s certainly possible. Use WP_Query to search for posts, then output them as you please.
For example, to get 20 posts from the category with the id 4:
<?php
$query = new WP_Query(
array(
'category__in' => 4
'posts_per_page' => 20
)
);
if ( $query->have_posts() ) {
echo "Here are some posts from that category:";
echo '<ul>';
while ( $query->have_posts() ) {
$query->the_post();
echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
}
echo '</ul>';
wp_reset_postdata();
}
To query other post types or taxonomies, look at the documentation, it has lots of examples.
Related Posts:
- Best Way to Redirect Category to Page and Hide Category
- is_category() in pre_get_posts strange error
- How to get posts from two categories with WP_Query?
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- How to make custom taxonomy check boxes like ‘Categories’
- Category and tag with same name
- How to create non-unique sub-category slugs?
- Loop with Dynamic Categories
- Automatically select categories on new post based on GET value
- So how to redirect category to a page of the same name if it exists?
- get only sub category ID
- Display categories inline
- Get tags specific category
- show posts names and links in the sidebar list as categories child
- Add a specific category at a specific place to the menu that uses wp_list_pages
- Filter posts under multiple categories?
- Categories not working – 404 Not found error
- How to not treat categories as tags in feeds
- How would I go about pulling the most popular (most used) categories?
- New Theme creation
- Custom order categories in admin dashboard
- multiple categories and breadcrumbs problem
- Editing Category Pages
- List subcategories of a specific product category (adapting from posts to products taxonomy)
- Get all subcategories and related posts
- How to get data about category in category.php
- Display tags from specific category in select fields
- Offline WordPress Application
- woocommerce product category tabs [closed]
- Taxonomy name repeating when showing 2 posts from each category
- How to change category and year archive permalinks/rewrite rules?
- The Category page shows all the posts, without differentiating by categories
- New Categories Not Shown In the Post Edit Page
- Different templates for different category tags
- Category param redirect to post type archive
- batch adding posts to a category based on matching regex for title with SQL
- Place category Base URL at the end
- Display Posts Loop for each parent and for each Child
- Listing Texts of Which Custom Field is Null
- How to set a filter by category within a customised page
- Post Count for Categories, however not to calculate a total
- Removing subcategories from permalinks [duplicate]
- Different banner for different section
- Flat category URLs but retaining hierarchy?
- Creating a custom feed for categories that includes the first post’s featured image
- echo category description in single.php
- Get categories without post
- Hide the word ‘category’ from my permalinks
- How to automatically check multiple categories on new post
- School & class blogs – renaming/archiving post categories?
- How do I get the parent category if I know the child category?
- How to exclude a particular category from the category list
- Hide specific category from wp_list_categories
- List just subcategory and products of active category page in Woocommerce
- Custom Meta Box (SELECT2) Not Saving Taxonomy Terms
- ow to display the number of posts in a category
- Force category choice before creating new post
- Listing posts under a category by date
- How to modify the “View all posts in category” title attribute
- Show post categories
- Exclude categories by ID
- Add description to categories menu in admin
- filter a loop base on specific category
- Display Sub-categories or Child Pages of Parent Cat/Page?
- How to check if a categoryID exists in a theme options page
- How to display product categories and number of sales on WooCommerce
- Display one category and its suncategories
- How to differentiate the homepage structure from the category page structure in WordPress template?
- Global navigation in multisite: problem with categories
- Placing category specific banner/html at top of respective category pages
- How to remove category name for only one category?
- Get parent category field from child category [closed]
- Custom sidebar isn’t showing up on sub-category posts
- Can a Woocommerce product category URL contain “&”?
- How can I display all products from all categories on one page with woocommerce?
- get_the_category return empty inside loop
- Unable to create pagination for Category.php
- Function add class to second menu specific items if the page has a certain category
- Posts says they are uncategorized but they are not
- How to call Primary Category for WordPress Woocommerce
- Meta Box: display single image on an archive-template
- Woocommerce change tag_id to name
- Im trying to add a div for just one category
- How to modify list categories code?
- Too many categories drastically slow down my website
- Configure query with multiple categories in a custom order?
- Get category fixed in dropdown browse categories
- Categories dropdown with all values selected using wp_dropdown_categories
- Category menu that filters out empty categories
- Create Cross Promoting Categories in WordPress Using ‘pre_get_posts’
- Category count but only if category has at least one post
- Determine the category that an archive-page is for
- Easiest way to display post archives in category-then-alphabetical order?
- Printing out Category and all Category Children on category.php
- How do I list all child categories that apply to current post?
- Can i know if it is Category first page or 5th?
- Exclude posts from certain category breaks custom pagination
- have_posts is empty on category.php
- How do i set up multiple portfolios (each with its own defined set of images -) to display on the same page?
- Hook action when create new category [duplicate]