Add Custom Slide Sources

The Posts slide source already supports posts, public custom post types and WooCommerce products. Two filters let you fine-tune which types appear and how their category filter works.

Offer a custom post type

Add your post type to the list the Content Type selector offers:

add_filter( 'nbc_slide_post_types', function ( $types ) {
	$types[] = 'portfolio';
	return $types;
} );

Map its taxonomy

Tell the Specific Category filter which taxonomy to use for that type:

add_filter( 'nbc_post_type_taxonomy', function ( $taxonomy, $post_type ) {
	if ( 'portfolio' === $post_type ) {
		return 'portfolio_category';
	}
	return $taxonomy;
}, 10, 2 );

Requirements

  • The post type should be public and its items need featured images to appear as slides.
  • The taxonomy you map must be registered for that post type.