• Hi ??

    I’m using WPML and everything is going fine. But I’m looking to give a specific category base for each language :

    Fr : site.com/rubrique/sport
    En : site.com/en/section/sport

    I made a specific plugin able to generate links like that.

    function cat_prefix(){
    	global $sitepress;
    $lang = $sitepress->get_current_language();
    switch($lang) {
    	case 'ar':
    		$pref = 'ركن';
    		break;
    	case 'fr':
    		$pref = 'rubrique';
    		break;
    	case 'en';
    		$pref = 'section';
    		break;
    	default:
    		$pref = 'rubrique';
    }
    	return $pref;
    }
    
    add_filter('option_category_base', 'cat_prefix');

    I don’t like to touch rewrite.php file or any WordPress Core files.
    So how can I add my own rewrite rules to do that ?

    Thank you ??

  • The topic ‘[WPML] Category base translation’ is closed to new replies.