[wp-testers] 3.1 Custom post types problems.

Andrew Johnson andrew at difted.com
Sat Feb 26 06:23:27 UTC 2011


Using fresh install, no plugins and I can't see the  "Edit Post" in my custom post types and my rewrites never work for the permalink generated. I can access via the /projects/post-name url but the permalink still generates as /post-name. Here is my code:

	add_action('init', 'custom_post_custom_init');
	function custom_post_custom_init() 
	{
	  $labels = array(
	    'name' => _x('Projects', 'post type general name'),
	    'singular_name' => _x('Project', 'post type singular name'),
	    'add_new' => _x('Add New', 'project'),
	    'add_new_item' => __('Add New Project'),
	    'edit_item' => __('Edit Project'),
	    'new_item' => __('New Project'),
	    'view_item' => __('View Project'),
	    'search_items' => __('Search Projects'),
	    'not_found' =>  __('No projects found'),
	    'not_found_in_trash' => __('No projects found in Trash'), 
	    'parent_item_colon' => '',
	    'menu_name' => 'Projects'
	  );
	  $args = array(
	    'labels' => $labels,
	    'public' => true,
	    'publicly_queryable' => true,
	    'show_ui' => true, 
	    'show_in_menu' => true, 
	    'query_var' => true,
	    'rewrite' => true,
	     'capabilities' => array('edit_post', 'read_post', 'delete_post','edit_posts','edit_others_posts'),
	    'has_archive' => false, 
	    'hierarchical' => false,
	    'menu_icon' => get_stylesheet_directory_uri() . '/images/project.png',
	    'taxonomies' => array('category', 'post_tag'),
	    'menu_position' => null,
	    'supports' => array('title','editor','author','thumbnail')
	  ); 
	  register_post_type('project',$args);
	}

Thanks for any help!

AndrewJohnson









More information about the wp-testers mailing list