Il existe deux méthodes pour ce faire,
Méthode 1
// Update the post-type post and then add your custom slug
add_action('init', 'update_default_post_slug', 1);
function update_default_post_slug() {
register_post_type('post', array(
'labels' => array(
'name_admin_bar' => _x('Post', 'add new on admin bar'),
),
'public' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'blogs'),
'query_var' => false,
'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats'),
));
}
Méthode 2
Vérifiez ceci: Different permalink structure for blog posts than pages in Wordpress?
J'espère que cette aide.
La méthode 1 son travail mais quand l'url montre "blogs /" l'url n'existe pas, apparait erreur 404 ... – user3810167