The following code in functions.php outputs a post when I publish, not a Page:
// custom post_type for agenda
add_action( 'init', 'create_my_post_types' );
function create_my_post_types() {
register_post_type( 'agenda', array(
'labels' => array(
'name_admin_bar' => _x( 'Agenda', 'add new on admin bar' ),
),
'public' => true,
'publicly_queryable' => false,
'capability_type' => 'page',
'map_meta_cap' => true,
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
'delete_with_user' => true,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
) );}
What am I doing wrong?
The full problem:
I need to add a metabox to a page, but only the "agenda" page, I don't want this metabox to appear in every page in admin panel, so I'm creating a custom post_type with the exact same functions of a page, only with a different post_type to be able to set a metabox to it alone.
Screenshot of current output:
https://i.sstatic.net/oPEx8.png (can't post direct images yet, so please click link)