Support » Fixing WordPress » Custom Permalink Issue

  • Resolved flashpunk

    (@flashpunk)


    I have 2 custom post types on a development blog i’m working on, one of them seems to be working fine, single entry pages, archives, etc.
    However, the 2nd one lists fine on taxonomy archive pages, however, any permalinks to single entry pages result in a 404 error page. This is in the front end, and also through the admin write panel when clicking on “View Page”.

    This is my function.php file showing the initialization of the custom post type. Any help would be very appreciated.

    Thank you!

    function post_type_musicians() {
    	register_post_type(
    		'music',
    		array(
    			'label' => __('Musicians'),
    			'singular_label' => __('musician'),
    			'public' => true,
    			'show_ui' => true, // UI in admin panel
    			'_builtin' => false, // It's a custom post type, not built in!
    			'_edit_link' => 'post.php?post=%d',
    			'capability_type' => 'post',
    			'hierarchical' => false,
    			'rewrite' => array("slug" => "musician"), // Permalinks format
    			'publicly_queryable' => true,
    			'query_var' => true,
    			'can_export' => true,
    			'menu_position' => 5,
    			'supports' => array('title','author','thumbnail','custom-fields','comments','revisions','editor','excerpt')
    		)
    	);
    
            register_taxonomy( 'albums', 'music',
    		array(
                 'hierarchical' => true,
    			 'label' => __('Music'),
    			 'query_var' => 'music',
    			 'rewrite' => array('slug' => 'music' )
    		)
    	);
    }
    add_action('init', 'post_type_musicians');
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Permalink Issue’ is closed to new replies.