Opened 12 years ago
Closed 12 years ago
#21468 closed defect (bug) (invalid)
Custom Post Type Permalink Returns 404 Error
Reported by: | imageac | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | critical | Version: | |
Component: | Permalinks | Keywords: | |
Focuses: | Cc: |
Description
Hi,
During WP 3.3.2, single-products.php was serving ' products ' custom post type. Since, I upgraded WordPress version from 3.3.2 to 3.4.1, I discovered permalink returns 404 error on Custom post type ' products '.
After adding following code in functions.php, it doesn't return 404 error, but redirect to homepage and still reluctant to serve requested content.
function produc_rewrite() { global $wp_rewrite; $wp_rewrite->add_permastruct('products', 'products/%postname%/', true, 1); add_rewrite_rule('products/([^/]+)/?$', 'index.php?post_type=products&postname=$matches[1]', 'top'); $wp_rewrite->flush_rules(false); // !!! } add_action('init', 'produc_rewrite');
I also have tried to disable all plugin and deactivated current theme to default theme 'twentyeleven', but nothing fruitful. Please assist me to recover my content for ' products ' custom post type.
Regards
Change History (3)
Note: See
TracTickets for help on using
tickets.
Trac is not a support avenue.
Please try the support forums.
Duplicate of #21417