Support » Fixing WordPress » Custom post type permalink not working (404)

  • Resolved adrian7


    I have the following code

    $itemlabels = array(
    			'name' 					=>  _x('Items', 'post type general name', WPDEV_THEME_TEXTDOMAIN),
    			'singular_name' 		=> _x('Item', 'post type singular name', WPDEV_THEME_TEXTDOMAIN),
    			'add_new' 				=> _x('Add Item', 'classsified', WPDEV_THEME_TEXTDOMAIN),
    			'add_new_item' 		=> __('Add New Item ', WPDEV_THEME_TEXTDOMAIN),
    			'edit_item' 				=> __('Edit Item', WPDEV_THEME_TEXTDOMAIN),
    			'new_item' 				=> __('New Item', WPDEV_THEME_TEXTDOMAIN),
    			'view_item' 				=> __('Visit item page', WPDEV_THEME_TEXTDOMAIN),
    			'search_items'			=> __('Search Item', WPDEV_THEME_TEXTDOMAIN),
    			'not_found' 				=> __('No items found', WPDEV_THEME_TEXTDOMAIN),
    			'not_found_in_trash'	=> __('No items in trash', WPDEV_THEME_TEXTDOMAIN),
    			'parent_item_colon' 	=> '',
    			'menu_name' 			=> __('Marketplace', WPDEV_THEME_TEXTDOMAIN)
    	$itemargs = array(
    			'labels' 					=> $itemlabels,
    			'taxonomies'			=> array('category'),
    			'public' 					=> true,
    			'publicly_queryable'	=> true,
    			'show_ui' 				=> true,
    			'menu_icon'				=> (get_bloginfo('template_url') . '/images/market-icon.png'),
    			'show_in_menu' 		=> true,
    			'query_var' 				=> true,
    			'capability_type' 		=> 'post',
    			'has_archive' 			=> true,
    			'hierarchical' 			=> false,
    			'rewrite'					 => array('slug' => 'product'),
    			'menu_position' 		=> 7,
    			'supports'		    	=> array('title', 'author', 'editor', 'custom-fields', 'thumbnail')

    Registers the post type, assigns the taxonomy – but the permalink (e.g. ALWAYS goes to 404 page!

    It is a WP bug – or it’s only me?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Chris Olbekson


    Level 12 Bug Squasher & Forum Moderator

    Anytime a new custom post type is registered the rewrite rules have to be flushed. Go to Settings -> Permalinks and click save.



    I have flushed them EVERYTIME!

    I might be wrong, but it might be a bug in WP 3.4.2…

    Had anyone tried registering a NEW custom post type with latest WP?



    I found the culprit. It’s this plugin:

    Once I deactivate it and re-saved permalink settings it worked. However I need to find another workaround, since I need that plugin.



    workaround found, commented the line nr.43 in kih-wp-links.php.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom post type permalink not working (404)’ is closed to new replies.