• Resolved Niels Pilon

    (@nielspilon)


    Hi,

    I have an issue on a new WP install which uses a few CPT’s created by the plugin. The setup for all the CPT’s is that they should also be shown in the Nav Menu. However, they are not.

    When exporting the setting it seems to be all correct:

    function cptui_register_my_cpts_cases() {
    
    	/**
    	 * Post Type: Cases.
    	 */
    
    	$labels = array(
    		"name" => __( "Cases", "" ),
    		"singular_name" => __( "Case", "" ),
    	);
    
    	$args = array(
    		"label" => __( "Cases", "" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"show_in_rest" => false,
    		"rest_base" => "",
    		"has_archive" => true,
    		"show_in_menu" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "cases", "with_front" => true ),
    		"query_var" => true,
    		"supports" => array( "title", "thumbnail" ),
    	);
    
    	register_post_type( "cases", $args );
    }
    
    add_action( 'init', 'cptui_register_my_cpts_cases' );
    

    I’ve already switched back to the default WP theme as I’m using a custom one. Also disabling all other plugins didn’t solve the issue.

    It’s not a big deal adding the menu items manually but this seems to me like some kind of bug…?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just to clarify, when you say Nav Menu, do you mean in the sidebar of your WP admin with the links to list them all, add new, and manage taxonomy terms associated? Or do you mean when visiting Appearance > Menus and the ability to add posts from the post type to WP menus meant for the frontend?

    The code provided is having no issue with the first scenario, it shows up in my WP admin menu. If it’s the second scenario, check your screen options tab at the top right corner of the Appearance > Menus section, and see if it’s available, but just not checked to display yet.

    Thread Starter Niels Pilon

    (@nielspilon)

    Hi Michael,

    Sorry for the late reply but it was the second scenario where the items where hidden because I didn’t check them at the screen options tab.

    Completely overlooked that option.

    Thanks,
    Niels

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Glad it was that simple of a solution ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘CPT not visible in Nav Menu’ is closed to new replies.