'Translate "project" and "project category" slug in Divi theme in WordPress
I managed to modify the standard "project_category" slug into "localita" and the standard "project" slug into "vendita". This is for the Italian side of the website. Now I am translating it into English, and I am trying to get those slug translated as well as follow:
- localita -> place
- vendita -> sale
- vendite -> sales
The php code used so far is the following:
add_filter('register_taxonomy_args',
'change_taxonomy_category_project', 10, 2);
function change_taxonomy_category_project($args, $taxonomy)
{
if ('project_category' === $taxonomy) {
$args['rewrite']['slug'] = 'localita';
}
return $args;
}
function change_taxonomy_project()
{
register_post_type('project',
array(
'labels' => array(
'name' => __('Vendite', 'divi'),
'singular_name' => __('Vendita', 'divi'),
),
'has_archive' => true,
'hierarchical' => true,
'public' => true,
'rewrite' => array('slug' => 'vendita', 'with_front' => false),
'supports' => array(),
));
}
add_action('init', 'change_taxonomy_project');
How can I get those strings translated by editing that code? I am using WPML to translate all the contents and currently using WordPress with Divi theme from Elegant Themes.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
