• Hi,

    I can’t find the option to translate ACF custom post types slugs using Polylang. I’ve enabled custom post types and taxonomies translations in the Polylang settings panel, but when I head over my ACF custom post type options > Tab “URL” I can only set the post value by default, and don’t have any support for my websites 2nd language.

    I tried copying this code into my child theme’s functions.php but without success :

    add_filter('pll_translated_post_type_rewrite_slugs', function($post_type_translated_slugs) {
    	// Add translation for "product" post type.
    	$post_type_translated_slugs = array(
    		'produit' => array(
    			'fr' => array(
    				'has_archive' => true,
    				'rewrite' => array(
    					'slug' => 'produits',
    				),
    			),
    			'en' => array(
    				'has_archive' => true,
    				'rewrite' => array(
    					'slug' => 'products',
    				),
    			),
    		),
    	);
    	return $post_type_translated_slugs;
    });

    Can you please help me out ?

    Cordialement,

    Paul

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.