How to Fix Error 404 In Custom Post Type
Custom post type is a concept familiar to devotees wordpress , if you ‘re a believer , then you surely will not be meeting at 404 in custom post type .
This error occurs when you single page of custom post type and it returns a 404 error , also known as page not found error .
For example, we declare a custom post type as follows :
add_action('init', 'create_sanpham_post_type');
function create_sanpham_post_type()
{
register_post_type('sp', array(...));
}
in the array is a string of information declared normal to declare a custom post type . You FOREIGN theater is a time and then when you do go to the product detail Suddenly it returns a 404 error .
Now we come to the functions.php file line custom post type as declared above , we add a line in the declaration , and it becomes as follows :
add_action('init', 'create_sanpham_post_type');
function create_sanpham_post_type()
{
register_post_type('sp', array(...));
flush_rewrite_rules();
}
You turned out to see the single still returns a 404 error again? Wish you success .