0

I'm trying to insert my custom post type within a menu of a theme. This theme actually have a custom post type called st_tours. So when I register my custom post type I do:

$args = array(
    'labels' => $labels,
    'has_archive' => true,
    'public' => true,
    'hierarchical' => false,
    'rewrite'   => array('slug' => 'tour'),
    'show_in_rest' => true,
    'exclude_from_search' => true,
    'show_im_menu' => 'edit.php?post_type=st_tours'
);

register_post_type('tour', $args);

but my custom post type isn't inserted in the menu of the theme, Wordpress define a new menu called Tour.

What I did wrong?

eg:

enter image description here

0

Here's the problem:

    'show_im_menu' => 'edit.php?post_type=st_tours'

You made a typo, it isn't show_im_menu, it's show_in_menu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.