Post types

This documentation for the Custom post types plugin for WordPress allows you to customize all features.

To get professional support you need to make a donation to get the PRO version of the plugin.

You can add as many post types as you like, as for the native WordPress public post types (posts and pages), if they are registered as public they will be present in the administrative menus and will be reachable from the frontend (single post type page).

New post type using UI

Registering and adding a new post type to your WordPress website has never been easier directly from the administration area.

  1. From the “Extend / Manage” menu click on the “Post types” item;
  2. From the “Post types” page at the top click on the “Add post type” button;
  3. Configure the new post type and click on the “Publish” button;
  4. The item relating to the post type created “Products” will be added to the main menu;
  5. Create and publish a “Product” as a blog post;
  6. See the new “Product” in the frontend;

New post type using hook

cpt_register_post_types

add_filter('cpt_register_post_types', function($postTypes){
    $postTypes[] = [
        'id' => 'products',
        'singular' => 'Product',
        'plural' => 'Products',
        'args' => [], // Array or string of arguments for registering a post type.
        'labels' => [] // An array of labels for this post type.
    ];
    // See https://developer.wordpress.org/reference/functions/register_post_type/
    return $postTypes;
});
This code is an example, add it to theme’s functions.php file or to custom plugin.

Manipulation hook

cpt_register_labels_{ID}

add_filter('cpt_register_labels_products', function($labels){
    $labels['edit_item'] = 'Customize product';
    // See https://developer.wordpress.org/reference/functions/get_post_type_labels/
    return $labels;
});
This code is an example, add it to theme’s functions.php file or to custom plugin.

cpt_register_args_{ID}

add_filter('cpt_register_args_products', function($args){
    $args['hierarchical'] = true;
    // See https://developer.wordpress.org/reference/functions/register_post_type/
    return $args;
});
This code is an example, add it to theme’s functions.php file or to custom plugin.
*** *******