Replace this line:
$featuredPosts->query('showposts=5&cat=8');
with
$featuredPosts->query(array('showposts' =>5, 'cat' =>8,'post_type' => array('post','events')));
Related Posts:
- How to show all posts of the category in wordpress?
- Get category id from post id of a custom post type
- Displaying category archive of custom post types
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- Glossary with Custom Post Type
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Categories assigned to custom post type not found
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Displaying custom post type on category pages but not on blog listings
- List all custom post type posts from a given category?
- How to customize the Categories meta box to allow only one category?
- Restrict categories to a custom post type
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Taxonomy structure of Sport site
- Getting all custom posts with a certain category
- get custom post type categories
- Display Custom Category (taxonomy) Name in Custom Post Type
- How to get category image custom post type taxonomy in wordpress?
- Query Custom Post Types & category_name?
- How do I get the child category posts from a custom post type?
- CPT posts listed by category with custom rewrite URL, please help!
- Return array of categories to php function for current post
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- How to get the post type from a category id?
- Insert HTML inside link in a walker
- Set menu active state for custom posttype and category, given custom taxonomy term
- Getting posts under the custom post type ui category
- Separate custom categories from default category
- wp_list_categories() – current-cat class also inside posts?
- Hide parent categories when clicked, and show it’s childs
- Limit amount of posts made within a custom taxonomy
- Post injections into Site Origins Page builder [closed]
- WordPress posts page for customer filtering and sorting along with category filter
- Multiple (two) category postings on the same page.
- School & class blogs: Categorize with categories or custom posts?
- Why is my category template ignoring post type?
- How to get custom posts sub category link
- Not sure if I should create multiple custom post type [closed]
- Custom post types and category archive
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- CPT category hierarchy
- Categorise Custom Post Types
- Tag page only display 10 posts
- in_category for custom post types
- WP_Query Custom Post Type if Category ID Equals
- Custom post types and ‘new WP_Query’
- get_category_link() for custom post type does not include custom slug rewrite?
- Showing custom post type categories in the menu
- Creating Sections for Post Types
- Listing all slugs?
- category list with cutom post count
- Get category if used in a custom post type
- List categories, subcategories and posts from custom taxonomy and custom post type
- Categories won’t appear on custom post type
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Custom post types category
- Advanced archive url structure (category, tag and date)
- Displaying taxonomies as category links within sidebar and creating pages for these
- Custom post category name showing empty
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- How to show related posts of category on post within custom posttype
- Sudden 404 pages on product category archives
- Custom Post Types – trying to make “title” display
- Convert category to custom post type
- How can I display a specific category on Front-Page
- Pagination for a cpt filtered with a category
- assign array of category to custom post type
- How to seperate posts by categories?
- How to manage a dynamic multi-level page hierearchy system?
- WooCommerce change
- Adding categories to custom post type in permalink
- Adding Custom Post Types to category/tag/author archives breaks header content
- Change custom post type permalink according to category
- I can not call the categories of custom post type
- Custom Post Type is not respecting assigned categories
- Help with Travel Guide Setup
- Update Cateogory Taxonomy Count for Attachment Post Type
- Project Category Heading
- Getting Custom post category from Form
- Help with Multi Level Category Archive Page
- How can I generate a list of post-type specific categories?
- Front end page submission form does not attach custom post type
- Best way to structure article and issue relationship for CPT
- Custom Post Type used for FAQs Accordion
- Category slug not showing for Custom Post Type
- Get a list of categories ids
- category page template for custom post type
- Custom Post Type Permalinks with %category%
- Display a custom post type list by taxonomy term
- Return Custom Post Type Categories
- Using tax_query to get single post per category
- Test if a Category contains certain Custom Post Types
- create category upon saving post and save post in that category
- What Is My Fault With This WP_QUERY ? [ Pagination Problem ]
- Is it possible to make is_category() recursive?
- Can a taxonomy of a custom post type be called ‘category’?
- How can I show second most recent post in sidebar, if most recent post is open in the browser?
- How to separate posts by categories?
- Custom Post Types Permalink
- How to add categories to a custom post type using wp_insert_post($new_post);