Enable Custom Post Types Categories

When you create custom post types in your WordPress site, you may also create custom categories for the new custom post types. To associate the new custom category taxonomy with the custom post types (for example, to use the new categories in the breadcrumbs of the custom posts), you can add the following code snippet filter into your child theme, typically in the functions.php file:

add_filter( 'pixfort/custom_types/categories', 'custom_categories_filter', 40, 1 );
function custom_categories_filter($customCats) {
$new = array(
'post_slug' => 'category_slug'
);
return array_merge( $customCats, $new );
}

*Where “post_slug“ is the slug of the custom post type and “category_slug“ is the slug of the categories of this custom post type.

** If you have multiple custom post types you just need to input each custom post type values in a new line inside $new array.

pixfort
pixfort
Support Team

Hey, this is pixfort support team, if you still need help you can always reach us via your pixfort account

Related Posts

Search

Start typing to search for a specific article on our website

Made with Popup Builder
Image link
Hey there

Search for a specific article

Get started

Check useful guides to get started

Still need Help?

Send us a support message

Our usual reply time: 1 Business day