• Hello,

    I had a Custom Post Type registered for team members. Somehow the “register code” was removed from my functions.php file. The data is still in the database and diplays on the front end of the website. Problem is i no longer have an admin panel to update this info.

    I have tried to re-register the post type but it doesn’t seem to be working. I am positive the post type is “team” because I confirmed this by logging into phpMyAdmin and viewing the post_type -> team.

    I’m not sure if the prefix (add_action(‘init’, ‘ppl_register’);) makes a difference but it doesn’t seem to when changing it on another post type.

    Anyway the code is below that I’m using to try and re-register the post type. Any help would be appreciated.

    // Register Post Type
    add_action('init', 'ppl_register');
    
    function ppl_register() {
    	$labels = array(
    		'name' => ( 'Team' ),
    		'singular_name' => ( 'Team Listing' ),
    		'add_new' => _x( 'Add New', 'Team Member' ),
    		'add_new_item' => __( 'Add New Team Member' ),
    		'edit_item' => __( 'Edit Team Member' ),
    		'new_item' => __( 'New Team Member' ),
    		'view_item' => __( 'View Team Members' ),
    		'search_items' => __( 'Search Team Members' ),
    		'not_found' =>  __( 'No Team Members found' ),
    		'not_found_in_trash' => __( 'No Team Members found in Trash' ),
    		'parent_item_colon' => ''
    	);
    
    	$args = array(
    		'labels' => $labels,
    		'public' => true,
    		'publicly_queryable' => true,
    		'exclude_from_search' => false,
    		'show_ui' => true,
    		'query_var' => true,
    		'rewrite' => true,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'menu_position' => 5,
    		'supports' => array( 'title', 'editor', 'thumbnail' )
    	);
    
    	register_post_type( 'team' , $args );
    }
    // End Register Post Type

    Thanks again!

  • The topic ‘Registering Custom Post Type’ is closed to new replies.