Your get_posts
call needs a posts_per_page
argument if you want more than whatever the default number per page is. Use -1
to retrieve all matching posts.
$featured_posts = get_posts(
array(
'post_type' => array( 'post', 'books', 'cds', 'maps' ),
'category' => get_theme_option('featured_posts_category'),
'posts_per_page' => -1
)
);
Related Posts:
- WP_Query by a category id and a custom post_type
- Exclude a category from WP_Query
- WP_Query ignores post_type in category view
- category__in not working on custom post type
- Retrieving 3 latest post from each of 5 different custom post types
- List with categories, subcategories and posts of custom posttype
- New WP_query in template not working with CPT+category on some pages
- WP Query group/order by category name
- List all custom post type posts from a given category?
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- Query Custom Post by Category
- Loop through categories and create tab for each
- Quickest way to get last or oldest post date – WP Query
- Getting all custom posts with a certain category
- Query Custom Post Types & category_name?
- Show Post Count of a Category
- CPT posts listed by category with custom rewrite URL, please help!
- Querying Term Posts in Loop
- Pagination on category page with custom post types
- How to show CPTs in term archive
- showing custom post types of a certain category only
- Linking to the most recent post in a Custom Post Type
- Show custom post type filtered by category
- forming WP_Query for posts of all post types but from specific categories
- Stuck in Order by more then one
- Query Multiple Custom Posts by Custom Fields
- WP Query with categories only shows one post and ignores the category
- Multiple (two) category postings on the same page.
- Why is my category template ignoring post type?
- WP the_posts() on single-cars.php get category link
- WP_Query Custom Post Type if Category ID Equals
- Custom post types and ‘new WP_Query’
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- List categories, subcategories and posts from custom taxonomy and custom post type
- WP Query results showing posts outside of category ID
- How to get Custom Post Type with Categories wise in WordPress using wp_query
- Group by custom field value (start and end times)
- Create query for both custom post type and category
- Get posts by category name
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- 4 posts per page from single category
- date_query empty results with custom post type
- Custom post type data not displaying If I select the category from the dropdonw
- How to output custom post type title on custom page with category next to it?
- Query a custom taxonomy in a function to create an csv file
- Custom Post By Category
- Query posts based on user preferences
- Only show categories that have posts within custom post type
- Query the title of the page to show posts with matching category in the loop
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Get post from Category by Priority
- How can you use a page for a custom post type?
- Only show current category post
- Can’t seem to filter wp_query by current category ID
- This wp_query will not return any posts and only seems to work with post_status inherit?
- Custom Post Type + Category archive
- Query posts by a type and another type only if post is in specific category
- category_name not working in WP_Query
- shortcode for recent custom type post
- Get all custom_post_type posts + blog posts from one category in a single query
- Using tax_query to get single post per category
- How do I correctly query posts from a post ID?
- Are custom posts included when getting a categories’ posts?
- Add Category names to post lists of custom post type
- Is it possible to make is_category() recursive?
- WP Query filtering by custom category not showing all relevant posts
- WordPress duplicating posts from single loop
- get_posts() function does not honor correct post type
- Should I use custom taxonomy or custom post type
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- How to detect filter in URL in Category page?
- Can I create a loop with multiple post types and specify different $args for each post type?
- Set menu active state for custom posttype and category, given custom taxonomy term
- Query custom post type by category slug
- Combining sorted and random CPT
- How to change post featured image using a custom field of category?
- How to add post_type=value when editing that post type in the WordPress admin?
- Display CPT posts based on specific taxonomy
- CPT Archive with core Category
- Can’t query tag and post_type at the same time
- Group posts by custom post type
- Setting proper query for multiple custom admin filters
- shortcode to show custom post types by category
- Unable to retrieve any posts of CPT in wp-admin
- WP_Query: include custom post type only with specific meta value
- Pagination on a custom post type loop
- Display all posts in main category and 1 subcategory
- Replace li Items with divs with classes
- WP_Query orderby modified to include custom meta changes
- WordPress custom loop filter by meta_key and value with serialize data
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- Returning a list of custom post types excluding those without a specific meta_value
- query private custom post type
- Get posts from a custom post type by child categories of a parent category
- Display custom post type from dynamic custom field
- Query/list all terms and their custom post count
- Custom Post Type Archive Page Filtering
- Getting posts under the custom post type ui category
- How to make sure content doesn’t display if selection is empty