Category : custom-post-type

I have 2 custom post types in my wordpress site, // Our custom post type function function create_posttype() { register_post_type( ‘properties’, // CPT Options array( ‘labels’ => array( ‘name’ => __( ‘Properties’ ), ‘singular_name’ => __( ‘Property’ ) ), ‘public’ => true, ‘has_archive’ => true, ‘rewrite’ => array(‘slug’ => ‘properties’), ‘show_in_rest’ => true, ) ); ..

Read more

Initial situation custom post-type (projects)[projects.php] <?php namespace main_themeextposttypesprojects; function post_type() { $labels = [ ‘name’ => _x( ‘Projects’, ‘Post Type General Name’, ‘main_theme’ ), ‘singular_name’ => _x( ‘Project’, ‘Post Type Singular Name’, ‘main_theme’ ), ‘menu_name’ => __( ‘Projects’, ‘main_theme’ ), ‘name_admin_bar’ => __( ‘Projects’, ‘main_theme’ ), ‘all_items’ => __( ‘Alle Projects’, ‘main_theme’ ), ‘add_new_item’ => ..

Read more

If I register a post type for example like this: function setup_post_type() { $args = array( ‘public’ => true, ‘label’ => __( ‘Recipe’, ‘textdomain’ ), ‘menu_icon’ => ‘dashicons-book’, ); // Should only be active in a given blog if( get_current_blog_id() === 14 ) { register_post_type( ‘recipe’, $args ); } } add_action( ‘init’, ‘setup_post_type’ ); it ..

Read more

So i used register_post_type to add books post_type section. but i want to show category and tags(and more) on the back panel. I know how to this(adding custom fields) in regular post. add_action( ‘init’, ‘bookworm_blog_cpt’ ); function bookworm_blog_cpt() { register_post_type( ‘book’, array( ‘labels’ => array( ‘name’ => ‘Books’, ‘singular_name’ => ‘Book’, ), ‘description’ => ‘Books ..

Read more