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?
- How to show related posts by detecting the current category?
- Display posts on a custom page from only a specific category?
- How to get the number of posts in a selected category?
- Show related posts by category but ignore one category
- Duplicate posts
- Looping through posts per category gives same posts for each category
- How can I extract the URL of a link from a post?
- Create a separate JS application for an individual post?
- 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?
- Post page to display specific category
- Exclude the first ‘n’ number of posts of a tag from home page?
- how to show single post in a custom template
- Using ajax on editing a category edit page?
- Query Posts by Custom Field
- How to get subcategories from category slug?
- Posts – display all posts except a post by an ID
- Loop doesn’t exclude the specified category in home page
- Parent category / child category posts
- Random posts that always include a particular post?
- Inserting Media to WordPress Posts
- Custom Post Type, post-formats associated to custom post type > 404 archives
- displaying the categories post
- What’s a theme that properly handles previews of different types of posts?
- Change content off every sixth element
- WordPress, custom post type and posts query help!
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- Filter products on category AND tag
- How to create loop of posts except post ID defined via ACF field
- Display Specific Categories posts on the home page
- Prevent Archive URLs
- show only one category and filter by tag
- Code to display random ordered posts in Categories across pages [duplicate]
- How can I exclude only a specific sub category post from category display?
- how to print total number of posts filtered by category?
- Is it possible to remove actual post pages in wordpress but keep them in categories
- Blog posts not displaying on blog posts page
- Need help with hiding an image within a post in a category
- How to filter out post from a category not its subcategory in wordpress dashboard
- WP_Query retrieve custom posts but not the post showing
- How to get alphabetic listing x other posts, based on first letter post?
- Exclude a ‘portfolio’ custom category?
- excerpt in template for specific page
- Only show posts belonging to multiple cateogries at same time
- Wrap posts from a category in HTML
- WordPress converting ‘ to ’ and – to –?