Re-Order Custom Post Type diplay in WP Admin

Community Forums Forums Design Tips and Tricks Re-Order Custom Post Type diplay in WP Admin

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  PhilMurray 11 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #66318

    PhilMurray
    Participant
    Post count: 69

    hi

    I added a custom post type called MEDIA COVERAGE to my child theme – it is working fine – however in the WP ADMIN the custom post type appears half way down the list of options in the left column of the WP Admin [ie: after Posts, Media, Pages, Comments]

    i would like it to appear directly after POSTS – how do i do this?

    the code i added to my functions.php

    //* Add a custom post type
    add_action( ‘init’, ‘cd_post_type’ );
    function cd_post_type() {
    // Media Coverage custom post type
    register_post_type( ‘media-coverage’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Media Coverage’ ),
    ‘singular_name’ => __( ‘Media Coverage’ ),
    ),
    ‘has_archive’ => true,
    ‘public’ => true,
    ‘show_ui’ => true, // defaults to true so don’t have to include
    ‘show_in_menu’ => true, // defaults to true so don’t have to include
    ‘rewrite’ => array( ‘slug’ => ‘media-coverage’ ),
    ‘supports’ => array( ‘title’, ‘editor’, ‘genesis-seo’, ‘thumbnail’,’genesis-cpt-archives-settings’ ),
    )
    );
    }

    thanks

    Phil

    #66322

    ramseyp
    Participant
    Post count: 99

    Phil,

    There is a parameter called “menu_position” you can use to position the menu. ( all the parameters are here: http://codex.wordpress.org/Function_Reference/register_post_type )

    Setting “menu_position” to 5 should place your post type menu item right under Posts.

    //* Add a custom post type
    add_action( 'init', 'cd_post_type' );
    function cd_post_type() { // Media Coverage custom post type
    	register_post_type( 'media-coverage', array(
    		'labels' => array(
    				'name' => __( 'Media Coverage' ),
    				'singular_name' => __( 'Media Coverage' ),
    			),
    			'has_archive' => true,
    			'public' => true,
    			'show_ui' => true, // defaults to true so don't have to include
    			'show_in_menu' => true, // defaults to true so don't have to include
    			'rewrite' => array( 'slug' => 'media-coverage' ),
    			'menu_position' => 5,
    			'supports' => array( 'title', 'editor', 'genesis-seo', 'thumbnail','genesis-cpt-archives-settings' ),
    		)
    	);
    }

    #66392

    PhilMurray
    Participant
    Post count: 69

    Brilliant ramseyp – that works perfectly

    thanks!

    Phil

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.