Already figured it out and seems to be working just fine.
// set up or arguments for our custom query
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$category = single_cat_title('', false);
$query_args = array(
'post_type' => 'post',
'category_name' => $category,
'posts_per_page' => 3,
'paged' => $paged
);
Related Posts:
- Query post category & remove any post id
- Sort Posts Alphabetically Based on Specific Category (Divi)
- How to show related posts by category
- How to add category to: ‘wp-admin/post-new.php’?
- Display all posts from specific categories on a page
- Query posts from current year
- Query only Posts from Both of Two Category?
- Order post by year DESC and month ASC
- Featured Posts for Category Pages
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- Random post category URL
- Category Foreach keeps looping?
- Assign category to new post via URL
- filter RSS feed in URL
- WordPress custom Query for Posts in Category display posts multiple times
- How can I setup a relationship using categories in WordPress?
- posts_per_page option limits the number of Gallery items
- How to make multiple sections in home pulling posts category wise?
- Counter is skipping post when I still want it visible [closed]
- Query for first 3 posts to change the look and feel
- How to give classname to post if post has no content?
- All categories displays the same posts
- WordPress displays post on subcategory only
- How to get posts ordered by using their categories?
- How to display only one category in a custom post type?
- Getting posts from some categories plus some individual posts
- Get current taxonomy and display query accordingly
- Can I show category name in url for only one of my categories?
- How to fetch courses in all languages in WordPress?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- How to add a ‘News’ section to specific posts in WordPress
- How to display particular categorie’s post which associated to specific user?
- Show 5 posts and than 3 posts offset with pagination
- AJAX load more posts not using correct category and repeating the same few posts
- How to run select query of post with category and tags?
- Query posts from newest category
- Sort Events by Venue Title – Sort Post set by related post ids
- Need help writing loop to display posts by categories in separate divs
- Sort / Filter Queries
- How can I display a specific number of post in a category via a url
- Ordering posts alphabetically by meta keys and title
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How to pass multiple checkbox values to wordpress query?
- Sort post by category using HTML Select tag
- Creating pages and getting their values from the database table
- How to limit post query to only return a total count of items with certain post statuses?
- Change from all posts to specific categories post on main page?
- Do I need to create a multisite for querying posts from multiple WordPress sites?
- Add a category to posts, that DO NOT contain two specific keywords?
- How to show related posts by detecting the current category?
- Display posts on a custom page from only a specific category?
- Multi row post list
- Using ajax on editing a category edit page?
- Related posts by category not working right
- How to list recent posts in a wp nav menu?
- Set Default Category to Username
- Disable sticky option for specific categories
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- How can I hide tags on a child-category page, if that tag has not been used?
- date issue with category post retrival
- Listing Specific Categories from Current Post with Depth
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- How to display two blog categories as separate sections on one page?
- Retrieve post ID from “querying” URL
- How i can limit period of post publication?
- Start post pagination at 0 instead of 1
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- How to make the first post in the loop be styled like a “new / featured” post?
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- How to setup a query to output posts by groups of five?
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- Single.php – Get Current Parent Category
- Order posts alphabetically: how to set order=asc in mysql query?
- How to order posts in an arbitrary order?
- How do I stop the loop from repeating in my category template?
- get_the_category listing in hierarchial order
- Is it possible to add/tick a category to a post when it is created?
- Excluding posts not working
- Display Posts on Custom Page
- How to get posts from a current post’s month?
- Exclude current custom post on single post
- Hide posts belongs to few categories in homepage
- Wrong post title displayed from loop
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- why does wordpress ignore the post args?
- Dynamically switch template on click
- How to get posts and comments amount per hour, per year and per month?
- While loop articles – if statement order
- post category in wp_insert_post
- do more action after I publish a post
- Retrieve only posts from a specific user in wp-admin/edit.php
- How do I Redirect a WordPress Page?
- Get all custom post types excepted some…
- Limit the number of posts a category can have – newest post goes in, oldest one drops out, possible? plugin?
- Conditionals if tags exist?