WordPress.org

Ready to get started?Download WordPress

Forums

"View" Link not showing in Custom Post Type (2 posts)

  1. NerdEnPose
    Member
    Posted 1 year ago #

    I have an issue with a recent Custom Post Type. When hovering over the title in the post list page on standard posts "Edit | Quick Edit | Trash | View" is shown. On my custom post type only "Edit | Quick Edit | Trash" is shown. Furthermore while editing a single post under the title the standard "Permalink" followed by an "Edit," "View Post" and "Short Link" is not on my Custom post either. I've disabled all plugins and poured over my code with no luck. Anyone have any ideas?

    function codex_custom_init()
    {
        $labels = array(
            'name' => _x('Wheels', 'post type general name'),
            'singular_name' => _x('Wheel', 'post type singular name'),
            'add_new' => _x('Add New', 'entree'),
            'add_new_item' => __('Add New Wheel'),
            'edit_item' => __('Edit Wheel'),
            'new_item' => __('New Wheel'),
            'view_item' => __('View Wheelset'),
            'all_items' => __('All Wheels'),
            'search_items' => __('Search Custom Wheels'),
            'not_found' => __('No Custom Wheels found'),
            'not_found_in_trash' => __('No Custom Wheels found in Trash'),
            'parent_item_colon' => '',
            'menu_name' => 'Wheel Gallery'
        );
        $args = array(
            'labels' => $labels,
            'publicly_queryable' => true,
            'show_ui' => true,
            'show_in_menu' => true,
            'query_var' => true,
            'rewrite' => true,
            'capability_type' => 'post',
            'has_archive' => true,
            'hierarchical' => true,
            'menu_position' => null,
            'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments','custom-fields','revisions','page-attributes','post-formats')
        );
    
        register_post_type('wheels', $args);
    
    }
    add_action('init', 'codex_custom_init');
  2. NerdEnPose
    Member
    Posted 1 year ago #

    Finally figured this one out. I didn't set 'public' to true.

Topic Closed

This topic has been closed to new replies.

About this Topic