Something like this should work :
$args = array ( 'post_type' => array( 'post', 'attachment'), 'category' => ARTICLE_CATID );
$query = new WP_Query( $args );
Related Posts:
- Get Posts Under Custom Taxonomy
- How to display related posts from same category?
- ZIP up all images displayed in a [gallery] and offer as download link
- How to show related posts by category
- How to add category to: ‘wp-admin/post-new.php’?
- Including categories in search results
- Use category base slug in posts’ permalink
- Different post sort order within different categories
- Count how many posts in category
- Custom Single Post By Category
- Setting Custom Sort Order of Posts within a Category
- How to get the number of posts in a selected category?
- How can you change the ‘Insert into Post’ title in the media button?
- MySQL Query to Retrieve Category from wp_posts
- Different number of posts in each category
- Display all posts from specific categories on a page
- Display the latest post from a category in a page
- media_handle_upload for local files?
- How to show list of posts by author and category?
- How do I detach images from posts?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Category checkbox list tree changes when editing a post
- How to add metabox for post of specific category
- Convert custom fields to post categories
- Manipulate post category after time
- Show related posts by category but ignore one category
- Replacing all attachment links in post with media file link
- How to sort posts by last name (2nd word) on ONE category only?
- How to disable Uncategorized category URL?
- Add role that restricts user to post in specific category
- How to get Category Id from Post Id ?
- Count posts in category including child categories
- Query posts from current year
- Getting Position of a post in a category
- Display only posts from a specific parent category
- How to control which category will be picked for the slug of a post?
- Categories box not showing on post edit pages
- get_the_term_list by hierarchy order
- How to change the layout and styling of posts according to their category in WordPress?
- List only child categories a post is in, of a specific parent category
- Add default content to post (for specific category)
- Query only Posts from Both of Two Category?
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- upload featured image from front end using wordpress add media button
- Add custom field to all posts in specific category
- Exclude category on blog list page
- display sub categories assoccited with each post in a category archive page
- is there a better way of combining this?
- Display most recent post in category instead of archive?
- How to display my categories in a list (to a post, not the sidebar)?
- How can I get on the same row two post of different categories?
- Polylang – display one post into 3 categories with different lang [closed]
- How to make category for word post_content
- How to sort the post to a specific category
- Listing category and its posts one by one
- Print out one of 2 post category [closed]
- How to get if category has posts?
- Show some texts in posts belonging to Specific category
- Export Posts Without Categories In An XML File
- wordpress category Description not allowed tag
- Broken images after importing posts and opening in Gutenberg
- View post with specific category id and name which I selected in the backend (drop-down option)
- Site ‘Categories’: save an admin global setting with post metadata [closed]
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Inserting Media on New Post But Hides Previous Uploads for Editor/Contributor
- How can I fixe the article title problem?
- Automatically select category based on user role
- Filters do not work when there are multiple (one works)
- I have a blog and want to prompt the user to select a category they like and have that select a random blog post
- What is the proper use of guid for images in wp_posts?
- How to remove category and other tags from posts page
- I have a website issue I am trying to resolve
- How to sort posts alphabetically based on a specific parent category
- Get the category of post from which category page it have been clicked
- Optimize blog that serves hundred of images and videos
- How to get a list of all posts and their categories?
- Show category name in category.php when posts assigned to multiple categories
- Images being uploaded via WP Media are not attached even they are used by some CPT posts
- Category and archive issue
- When inserting media file in a post or page, show file name under the thumbnail
- Error counting posts of category
- Adding content to the top of post’s based on their category
- Show posts assigned to multiple categories in current category page
- WordPress converting ‘ to ’ and – to –?
- Add a category to posts, that DO NOT contain two specific keywords?
- Menu for all posts from multiple categories
- How to display related posts from the same category?
- How to show related posts by detecting the current category?
- Display posts on a custom page from only a specific category?
- Preset category checkbox from URL parameter when creating new post
- What is the best way to publish News articles?
- WordPress menu disappears in category pages
- Undefined array key “width” in wp-admin/includes/image.php error when publishing post or page
- How to specify a post category for the home (posts) page?
- Unable to create categories and tags for posts in wordpress multisite
- Exclude the Newest Recent Post from their Category After New post Publish old post should be in their category at Home Page
- Menu item on a category
- Display posts from a specific category on frontpage.php template?
- Mismatch between posts count and actual list in admin posts page
- How to display blog posts per category using tabs or accordion?