• I’ve created a post type but can not view page itself. My post type is called “weeklytips”. However when I try to view the page it defaults to my index.php. I’ve created a weeklytips.php but it still goes to the index.php.

    How do I fix this?

    add_action( 'init', 'word_post_types' );
    function word_post_types() {
    	register_post_type( 'weeklytips',
    		array(
    			'labels' => array(
    				'name' => __( 'Weekly Tip' ),
    				'singular_name' => __( 'Weekly Tip' ),
    				'add_new' => __( 'Add New' ),
    				'add_new_item' => __( 'Add New Weekly Tip' ),
    				'edit' => __( 'Edit' ),
    				'edit_item' => __( 'Edit Weekly Tip' ),
    				'new_item' => __( 'New Weekly Tip' ),
    				'view' => __( 'View Weekly Tip' ),
    				'view_item' => __( 'View Weekly Tip' ),
    				'search_items' => __( 'Search Weekly Tip' ),
    				'not_found' => __( 'No Weekly Tips found' ),
    				'not_found_in_trash' => __( 'No Weekly Tips found in Trash' ),
    				'parent' => __( 'Parent Weekly Tip' )
    			),
    			'public' => true,
    			'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields' ),
    			'taxonomies' => array( 'post_tag', 'category'),
    			'rewrite' => true,
    			'query_var' => true
    		)
    	);
    	register_taxonomy_for_object_type('category', 'weeklytips');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Post Type file name?’ is closed to new replies.