Something like this should work :
$args = array ( 'post_type' => array( 'post', 'attachment'), 'category' => ARTICLE_CATID );
$query = new WP_Query( $args );
Related Posts:
- MySQL Query to Retrieve Category from wp_posts
- Category checkbox list tree changes when editing a post
- How to sort posts by last name (2nd word) on ONE category only?
- List only child categories a post is in, of a specific parent category
- is there a better way of combining this?
- Single.php Active Category Class
- Most efficient way to list all categories and display a post for each of them?
- prevent showing posts of an specific category in admin posts section
- wp_list_categories link to first post of category instead of calling taxonomy template
- Auto set Post to Specific Categories
- How to Add ‘Post Categories’ to the Dashboard Sidebar
- New blog template to display only one category
- How only display all post related to category
- WordPress menu that shows all posts in a certain category like w3schools
- How can I list random authors from current post category?
- Add category to all post by using sql query?
- How do I render all posts of the same category in same layout?
- How to limit displayed posts on wordpress
- WordPress list posts from sub categories
- Select a random post from a specific category?
- How to filter posts that belong to a specific category only if that is the only category
- Category List (Archive) Page Template By Category
- List posts in a given category
- Child_of not displaying all children posts.. via get_posts
- post categories
- wp-cli post create & media import issues
- How can i limit the number of posts created per category?
- Get Posts Under Custom Taxonomy
- Prevent additional top level categories but allow more children
- Removal of Media Gallery pictures
- If in_category not working for multiple single.php pages
- Excluding posts not working
- Hide posts belongs to few categories in homepage
- post category in wp_insert_post
- Limit the number of posts a category can have – newest post goes in, oldest one drops out, possible? plugin?
- Remove current category from post but display all others
- Display posts of specific category term
- Widget that shows categories with posts numbers
- How do I show posts from another wordpress installation?
- Latest posts by category — how to exclude current post?
- How do I include the category next to the title of a post?
- Relative number of post in category
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- Display selected categories onto post page
- Change the background of each post according to the category
- Remove Featured Image from posts in specific category?
- Get post category as a separate string and url
- Sidebar limiting to 10 posts?
- How to view all posts (on site, not admin) that are uncategorized?
- How to create a list of links to post with specific category
- How to list post as buch of category, and all of them
- How can I add a page that shows posts from a single category?
- Post in bulk based on category template
- Delete Post but retain image of post [WP REST API]
- Remove subcategory slug from url
- Site/Post preview is not working on all social media
- Can I show category name in url for only one of my categories?
- Automatic duplicate/copy of post to a related page in WordPress
- get category in list of posts // shortcode for custom related posts
- Is there a way to categorize a list posts all at once?
- Yoast breadcrumb URL shows category instead of the page
- Getting image data from phone camera (MediaDevices.getUserMedia) into user post
- On the online version of my blog posts disappear
- Current post categories and subcatecories outside of the loop
- Query prints posts without specific categories
- Foreach issue in get_posts function
- More Than 50K Categories and WordPress Admin Panel Stop Showing Categories and Posts
- Re-order Category Meta-data
- Custom post styling per category?
- How to run select query of post with category and tags?
- post categories – how to show only categories with a specific parent id
- Creating a “category” of featured posts
- How do I make it so that new posts within a certain category go into a certain page?
- List Authors For Current Category
- Static text above category page
- List posts of assigned categories in list of all categories on single.php
- Show only top 3 posts from 3 categories in order on home page
- Disable Media uploader to users
- Assign specific ads to specific categories/posts
- Order posts by separate menu order for different sub-categories
- find posts with exactly 3/4 categories
- Use radio buttons & checkboxes for post categories
- Delete old post with new post
- Displaying only posts from a certain category on my custom page template
- I need to create a page or post hierarchy
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- Add default content to post (for specific category)
- List posts that are in the same category as the current post title
- Multiple blog “feeds” in a single blog each with distinctly styled post pages
- How to get pagination working with “Pending” Posts
- Post’s arent displaying
- Show with echo if a post has two or more categories
- How can I get on the same row two post of different categories?
- Filters do not work when there are multiple (one works)
- Optimize blog that serves hundred of images and videos
- Show category name in category.php when posts assigned to multiple categories
- Error counting posts of category
- Display posts from a specific category on frontpage.php template?
- Cant display custom post type posts from a specific category WordPress