WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I click on preview in custom post types I get redirected to home page. But when I visit or view the page that have all the Custom posts in I can see all of them.

I cant figure out what or why.

NOTE I allready tried all the Settings -> Permalinks options.

Update #1 CTP registration

function register_cpt_cars() {
    $labels = array( 
        'name' => _x( 'Cars', 'cars' ),
        'singular_name' => _x( 'Cars', 'cars' ),
        'add_new' => _x( 'Add new', 'cars' ),
        'add_new_item' => _x( 'Add new Car', 'cars' ),
        'edit_item' => _x( 'Edit Cars', 'cars' ),
        'new_item' => _x( 'New Car', 'cars' ),
        'view_item' => _x( 'Show cars', 'cars' ),
        'search_items' => _x( 'Search Car', 'cars' ),
        'not_found' => _x( 'No car found', 'cars' ),
        'not_found_in_trash' => _x( 'No cars found in the trash', 'cars' ),
        'parent_item_colon' => _x( 'Parent cars:', 'cars' ),
        'menu_name' => _x( 'Cars', 'cars' ),

    $args = array( 
        'labels' => $labels,
        'hierarchical' => false,
        'description' => 'New Cars',
        'supports' => array( 'title', 'editor', 'thumbnail' ),
        'taxonomies' => array( 'category'),
        'public' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'menu_position' => 20,
        'menu_icon' => get_stylesheet_directory_uri() . '/img/icons/53-house.png',
        'show_in_nav_menus' => true,
        'publicly_queryable' => true,
        'exclude_from_search' => false,
        'has_archive' => true,
        'query_var' => true,
        'can_export' => true,
        'rewrite' => true,
        'capability_type' => 'post'

    register_post_type( 'cars', $args );

Update #2

Tried removing rewrite and capability_type from CTP registrations. Still dont work. I get to my homepage but the URL changes.

share|improve this question
How about showing us your CPT registration code? – kaiser May 29 '13 at 12:20
@kaiser - Sorry my bad, question updated with CTP code. – M3o May 29 '13 at 12:23
Remove capability_type and rewrite. Then try again. Additional info: Remove everything that is already a default value from core. Sidenote: We don't understand Viking... so better use English in all cases so later readers understand your question as well... – kaiser May 29 '13 at 12:26
@kaiser - Ok , translated. I tried as you suggested but it didnt work. I still see the home page but the url has changed. Any more suggestions on that one ? – M3o May 29 '13 at 12:36
Please always go back and update your question with what you've tried. So if you removed all the default values, then please show us what is left now. You asked already 17 questions - you should know better. Thanks. – kaiser May 29 '13 at 12:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.