Wordpress multiple slugs for a Custom Post Type -
a custom post type can registered 1 slug (e.g. products)
register_post_type('products', $args);
how can add multiple slugs same custom post type?
website_address.com/en/products/ website_address.com/fr/produits/ website_address.com/it/prodotti/
the rewrite argument register_post_type()
accepts array. 1 of array keys slug
. i18n this:
register_post_type( 'products', array ( 'rewrite' => array ( 'slug' => _x( 'products', 'url slug', 'your_text_domain' ) ) ) );
idea taken here.
ref: https://codex.wordpress.org/function_reference/register_post_type
Comments
Post a Comment