Home › Forums › Theme support › how to change posttype or permalink URL
This topic contains 6 replies, has 2 voices, and was last updated by 7Theme Support 9 years, 6 months ago.
-
AuthorPosts
-
Hi there,
I’ve noticed that classes are posttype wcs3_class. If I now turn on permalinks based on postname, then my URL would become foo.bar/wcs3_class/latindance/
That wcs3 is SEO wise obviously wrong, I would like to change that to the dutch word for classes “lessen”. How can I achieve that?
I’ve read this post http://7theme.net/forums/topic/translation-for-the-wordpress-backend/ but I would like to be able to update the theme as well and I don’t think these adjustments are achievable in a child theme only…
Thanks!
Hi Vincent,
the easiest way to change this is to change the rewrite rules. Please take a look at this post here:
Just add the code to the “functions.php” file to change the permalinks
Thanks for the link. But that doesn’t replace your created “Classes” and posttype “wcs3_class” in wp-admin to what I want.
If I use the solution posted in your link, I am able to access that class page http://streetdancemaastricht.nl/wcs3_class/spinning/ like http://streetdancemaastricht.nl/lessen/spinning/ but it doesn’t feel right. I want to totally replace that wcs3_class name.
If I check the source of http://streetdancemaastricht.nl/lessen/spinning/ then the canonical tag is again pointing to /wcs3_class/spinningAny advise?
Thanks in advance!
Here’s what I found about slugs. Making them translatable at register point. http://wordpress.stackexchange.com/questions/65680/internationalize-translate-custom-post-types-taxonomies/65951#65951
Is this correct and maybe something you can provide in a next release?
(I know the classes posttype and slug come from the additional plugin, but the included team, client etc posttypes should be translatable as well (preferrable)
sorry for the many replies. The edit function disappears after some time…
Here’s the solution:
// Change ‘wcs3_class’ slug to ‘Dansstijlen’
register_post_type(
‘wcs3_class’,
array(
‘labels’ => array(
‘name’ => __(‘Dansstijlen’),
‘singular_name’ => __(‘Dansstijl’)
),
‘public’ => true,
‘has_archive’ => true,
‘rewrite’ => array(
‘slug’ => ‘dansstijl’
)
)
);// Change ‘wcs3_instructor’ slug to ‘instructeur’
register_post_type(
‘wcs3_instructor’,
array(
‘labels’ => array(
‘name’ => __(‘Instructeurs’),
‘singular_name’ => __(‘Instructeur’)
),
‘public’ => true,
‘has_archive’ => true,
‘rewrite’ => array(
‘slug’ => ‘instructeur’
)
)
);Hi,
great, thank you for sharing your solution!!
And yes, you are right, maybe we should also make translatable the backend, like clients and portfolio…
-
AuthorPosts
You must be logged in to reply to this topic.