• Hi there,

    When i activate my theme :

    • I create home page
    • I create news liste page
    • i create 2 different language with pll_admin_model $model->add_language ($args)
    • I set the two pages as static and blog page

    I would like to rewrite the permalink structure as :

    • /A-WORD/%category%/%postname%/ for fr_FR
    • /A-WORD-TRANSLATED/%category%/%postname%/ for en_EN

    For this i thought use :

    add_action( 'after_setup_theme', '_reset_permalinks' );
    function reset_permalinks() {
        global $wp_rewrite;
        $wp_rewrite->set_permalink_structure('/%category%/%postname%/');
        $wp_rewrite->flush_rules();
    }

    But how can i put the A-WORD and the translation before the /%category%/

    Thank you so much for your help
    Jo

    • This topic was modified 3 years, 6 months ago by Jonathan.

The topic ‘Set_permalink_structure after setup theme translate’ is closed to new replies.