Registering a custom post type as following and the slug input is not shown. Any ideas why?

res = register_post_type( 'twig_anything_tmplt', [
        'label' => 'Twig Templates',
        'labels' => [
            'name' => 'Twig Templates',
            'singular_name' => 'Twig Template',
            'menu_name' => 'Twig Templates',
            'add_new_item' => 'Add New Twig Template',
            'edit_item' => 'Edit Twig Template',
            'new_item' => 'New Twig Template',
            'view_item' => 'View Twig Template',
            'search_items' => 'Search Twig Templates',
            'not_found' => 'No Twig templates found',
            'not_found_in_trash' => 'No Twig templates found in trash',
        'description' => 'Twig templates used by the Twig Anything plugin.',
        'exclude_from_search' => true,
        'publicly_queryable' => false,
        'show_ui' => true,
        'show_in_menu' => true,
        'show_in_admin_bar' => true,
        'menu_position' => 20,
        'menu_icon' => 'dashicons-images-alt2',
        'hierarchical' => false,
        'supports' => ['title', 'editor'],
        'has_archive' => false,
        'rewrite' => [
            'slug' => 'twig_anything_tmplt',
            'with_front' => true,
            'feeds' => false,
            'pages' => false,

Its there you just need to click on "screen options" and make sure the checkbox is checked

enter image description here

  • I don't want the slug to be displayed in a separate secton. I need it directly under the post title, just as it is displayed for posts/pages. – Meglio Jul 6 '15 at 10:40

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.