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?
- Get the ID of the latest post
- How do you get the count of posts in an archive page?
- how to filter by last name for custom post
- Get categories for a specific post – Custom post type
- query order by date on custom type: wrong order
- Categories not working as expected with custom post type
- Help with CPT template pagination
- Get categories and descriptions from custom post type
- How to connect two custom post types with nested loops
- Custom Post type and Custom Field WP_Query
- Query/list all terms and their custom post count
- Get custom taxonomies from multiple posts
- Pagination on with query_posts in custom post type template
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Why is my WP_Query outputting my entries twice?
- Custom WP_Query doesn’t display all posts
- WP_Query() with custom post type and taxonomy — get all terms?
- Query & the_content() is showing in the header
- Pagination not working on custom query on a page
- Query within a foreach within a query (queryception)
- Is it possible to use array_walk() to append terms to an array of posts?
- Custom Post Type Custom Archive Page Not Working
- Problem while filtering by ‘category_name’
- How to order query results based on if a custom field has been populated, then the order by the date of the post?
- WP_Query get always custom post_type for first
- Category permalinks don’t work even after flushing
- meta query multiple values for the same key
- Wp Query sort order from custom MetaBox
- Reuse the “category” slug for a custom post type
- Custom post types not displaying per category
- Popup panel is only displaying 1 entry ignoring all others
- Custom post type single display is ommited
- Select Category as Page Parent
- Quering array of post types & pagination. Articles are repeating sometimes on different pages