Page VIew

Support MB Custom Post Type Page VIewResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16562
    localrouteslocalroutes
    Participant

    I am definitely missing something, here.

    Can you please inform me of which CPT option sets up the "View" of the post type?

    Or, if it is not an option, how do I get it to assign a URL so the single will be displayed?

    Thanks

    #16583
    Anh TranAnh Tran
    Keymaster

    Hi,

    I'm not quite clear about the question. Each post type registered with the plugin is a normal WordPress post type, which uses single-{$post_type}.php template file to display (and fallback to single.php. See WordPress docs for more details.

    The URL for each post in the post type is automatically generated if you set the permalink to something different than the default.

    #16595
    localrouteslocalroutes
    Participant

    How strange! Neither of my new post types are showing anything about a view URL
    See SS http://prntscr.com/pkyzbr

    function your_prefix_register_post_type() {
    
     $args = array (
            'label' => esc_html__( 'Dashboards', 'text-domain' ),
            'labels' => array(
                'menu_name' => esc_html__( 'Dashboards', 'text-domain' ),
                'name_admin_bar' => esc_html__( 'Dash', 'text-domain' ),
                'add_new' => esc_html__( 'Add new Dash', 'text-domain' ),
                'add_new_item' => esc_html__( 'Add new Dash', 'text-domain' ),
                'new_item' => esc_html__( 'New Dash', 'text-domain' ),
                'edit_item' => esc_html__( 'Edit Dash', 'text-domain' ),
                'view_item' => esc_html__( 'View Dash', 'text-domain' ),
                'update_item' => esc_html__( 'Update Dash', 'text-domain' ),
                'all_items' => esc_html__( 'All Dashboards', 'text-domain' ),
                'search_items' => esc_html__( 'Search Dashboards', 'text-domain' ),
                'parent_item_colon' => esc_html__( 'Parent Dashboard', 'text-domain' ),
                'not_found' => esc_html__( 'No Dashboards found', 'text-domain' ),
                'not_found_in_trash' => esc_html__( 'No Dashboards found in Trash', 'text-domain' ),
                'name' => esc_html__( 'Dashboards', 'text-domain' ),
                'singular_name' => esc_html__( 'Dash', 'text-domain' ),
            ),
            'public' => true,
            'description' => 'Give members front and center control over their directory information.',
            'exclude_from_search' => false,
            'publicly_queryable' => false,
            'show_ui' => true,
            'show_in_nav_menus' => true,
            'show_in_menu' => true,
            'show_in_admin_bar' => false,
            'show_in_rest' => false,
            'menu_icon' => 'dashicons-admin-collapse',
            'capability_type' => 'post',
            'hierarchical' => false,
            'has_archive' => 'all-dashboards',
            'query_var' => false,
            'can_export' => true,
            'menu_position' => 57,
            'supports' => array(
                'title',
                'editor',
                'author',
                'excerpt',
                'custom-fields',
            ),
            'taxonomies' => array(
                'category',
                'post_tag',
            ),
            'rewrite' => array(
                'slug' => 'dashboards',
            ),
        );
    
        register_post_type( 'dd_dashboard', $args );
    }
    add_action( 'init', 'your_prefix_register_post_type' );
    #16612
    Anh TranAnh Tran
    Keymaster

    Please try setting query_var and publicly_queryable to true.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.