You can refer this.
Use the examples part. Inside the foreach loop put your all the code which needs to be repeated for each category type.
something like:
<?php
$categories = get_the_category();
if($categories){
foreach($categories as $category) {
$my_query = new WP_Query('cat=$category->term_id');
//code to display category posts goes here
}
}
?>
You are ready to go with this.
Related Posts:
- Blog post per page setting conflicting with custom WP_Query?
- How to : pagination in 3 different custom loops on the same page
- Getting blog pagination to work on page set as front page
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Should we trust the post globals?
- The next_posts_link() works only with original $wp_query
- Get first post from wp_query
- WP_Query: Why is sticky post not first item in loop?
- Query *only* sticky posts
- Skipping first 3 posts in wp query
- How do I reorder (pop and push) items from WP_Query?
- How to exclude latest x posts from a paginated query?
- Reverse chronology of post listing
- WordPress Number of Posts Not Changing With posts_per_page
- Pagination not working on Custom Page Template
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Specific loop in Shortcode
- Search widget breaks when using multiple loops?
- Display posts with comments closed, with pagination?
- Group posts by year in loop
- How would I get 1 latest post from a query for 5 posts?
- Lazy Load using WP_Query pagination
- Loop through all product posts?
- How to display different number of posts
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- WP Query – duplicated posts once including tags in search results
- Display post from current category and same tag?
- Why WP_Query(‘showposts=5’) shows only 1 post?
- How to exclude latest x posts from a paginated query?
- Blog page pagination is not working after using the offset argument
- WP Query – Posts Per Page not working in combination with category__in
- Pausing and Resuming WP_Query results
- Pagination with an array of post objects?
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- Start WP Pagination From Number 1 in URL
- List authors with the last post title and order by last post date
- Use two different post_per_page limits with infinite scroll
- wp_query random post
- Possible to alternate between two loops
- Why are my paginated posts always returning the same results?
- How to get posts published on the latest date?
- Page and post loop same template
- Display current post position in Elementor Posts widget
- WP_Query: Show 10 posts in date order, first three random
- WordPress Loop: How to display recent posts in multiple divs
- How to display post list in a table layout (multiple queries in single loop)
- Not all posts showing in query
- how to handle the loop using filling bootstrap grid structure?
- Custom WP_Query not working correctly
- WP_Query of Category Not Showing First Post
- Display 3 posts with different HTML markup using a loop
- Pagination for normal (standard) posts on a page with a custom loop?
- While loop in functions.php outputting the_title() of each post on frontpage
- Manipulated offset and pagination, can’t display last post anymore
- Display specific posts based on an ID of another post
- show loop id post , only first id can read
- How can I get the last post while on the first post for pagination? As if it were infinite
- Double loop output
- Override wp_link_pages pagebreak with filter
- Loop through all posts showing duplicates
- Can I Paginate Post after every 25 tag?
- Wp_query loop is not working as it should
- Posts are not showing up on next page.
- WordPress loop uses unmodified posts array, why?
- Advanced Post Display/Pagination/Ordering
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- How to show the posts list into a static page? Problems to use the loop into a static page
- Pagination for custom query won’t let me back on page 1
- Adding a category at even positions on main loop with modified pagination
- Make assigning post to a specific category equivalent to assigning it to all categories
- Can’t get pagination to work
- How to inject a post within a loop
- The next_posts_link() works only with original $wp_query
- WordPress posts loop pagination – first page return 125 posts instead of 10 and the rest return 10
- Limit amount of pages shown in pagination within wp_query
- How do I show the post title if an advanced custom field hasn’t been used?
- First post in loop displays twice
- posts_per_page – Repeats only first posts ‘post__in’ array
- query_posts different amount of posts per page [duplicate]
- Is it possible to use the_post 2 times in one loop
- subtracting the current post form then whole loop, which is generating all CPT titles
- How to display the pagination in my post list? [duplicate]
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- WP_Query that targets all categories
- Disable pagination in posts and pages
- Counting Posts by Category
- Fill the exclude array() in get_posts()
- show image gallery in archives or category page
- Page with Category Returning 1
- The first post appears twice
- Pagination (on the static front page) shows always the same posts
- Loop and output 4 rows of posts on home page
- Code to display random ordered posts in Categories across pages [duplicate]
- filter posts based on menu_order
- Count posts for pagination
- Show 5 posts and than 3 posts offset with pagination
- Custom post Query and WordPress Post Query Clash
- Paging works correctly on local version, but not live?
- Get current_post in reverse order with pagination
- Change archive results based on GET request