Wordpress 3.1.2 Permalink

I have a new version of WordPress 3.1.2 (not updated, but a new one installed) that does not contain any plugins.

I have what seems to be a fairly common problem from my googling, but none of the solutions that I can find for me work.

I have a custom taxonomy and a custom post type, code from my functions.php:

register_post_type( 'product', array(
    'labels' => array(
        'name' => __( 'Products' ),
        'singular_name' => __( 'Product'),
        'add_new_item' => __( 'Add New Product'),
        'add_new' => __( 'Add a Product'),
        'edit_item' => __( 'Edit Product'),
        'new_item' => __( 'New Product'),
        'view_item' => __( 'View Product'),
        'search_items' => __( 'Search products' ),
        'not_found' => __( 'No products found' ),
        'not_found_in_trash' => __( 'No products found in Trash' )
    ),
    'public' => true,
    'supports' => array(
        'title',
        'editor'
    ),
    'has_archive' => true,
    'can_export' => true
));

register_taxonomy( 'product_category', 'product', array(
    'hierarchical' => true,
    'labels' => array(
        'name' => 'Product Categories',
        'singular_name' => 'Product Category',
        'search_items' =>  __( 'Search Product Categories' ),
        'all_items' => __( 'All Product Categories' ),
        'parent_item' => __( 'Parent Product Category' ),
        'parent_item_colon' => __( 'Parent Product Category:' ),
        'edit_item' => __( 'Edit Product Category' ), 
        'update_item' => __( 'Update Product Category' ),
        'add_new_item' => __( 'Add New Product Category' ),
        'new_item_name' => __( 'New Product Category Name' ),
        'menu_name' => __( 'Product Categories' ),
    ),
    'public' => true,
    'rewrite' => array(
        'hierarchical' => true
    )
));

The problem is that when I go to the archive page product_category, for example http://example.com/dairy-industry , I get 404. I have tried the gadget fixes, including

  • each combination of arguments rewritein coderegister_taxonomy
  • Saving permalinks
  • turn constant motion, save, and then turn them on again
  • above, but first delete the .htaccess file from the server
  • , rewrite_rules wp_options
  • ( )

$wp_rewrite- > flush_rules() .

, , , , 404s. , , . .

, , (dairy-industry) , (2011/04/dairy-industry-products) , 404.

, , .

- ?

+5
4

: word-press-permalinks-broken-fro-category-and-tags-404-error-page-not-found

, " " " ", :

$wp_rewrite->flush_rules();

:

/* $wp_rewrite->flush_rules(); */

permlinks .... .

0

. , , slug-, ! -, .

, URL. CMS Press.

0

404 permalinks, . , . , ... ... , .

: http://wpcodesnippets.info/blog/how-to-fix-the-wp-3-1-custom-permalinks-bug.html

, WP. . , .

As for your random 404 new posts, I am particularly interested if you find the culprit. Here is one thing to try. Once this happens with a new message, pull your site in a browser that you usually don’t use ... and see if you can click on the link to the new message from there.

Of course, older plugins that modify or access the permalink structure need minor modifications until WP solves the problem.

Anyway, I'm glad the plugin helped.

0
source

All Articles