• Ciao,
    scrivo in italiano, il mio inglese scritto lascia a desiderare (speriamo che con l’italiano vada meglio), scusate.

    Dovrei filtrare un custom post type per lingua. Se uso:

    $args = array(
    	'post_type' => 'my_cpt',
    	'lang' => 'en'  //Language slug
    );
    $query = new WP_Query( $args );

    non filtra.

    Ho provato quindi:

    'meta_query' => array(
    					array(
    							'key'     => '_cml_lang_id',
    							'value'   =>  $currentLang->id,
    					),
    			),

    funziona, ma noto che non tutti i post hanno questa chiave impostata, quindi non mi pare una soluzione affidabile.
    Pertanto come ottenere i posts filtrati per lingua?

    grazie mille per il preziosissimo lavoro
    ciao

    https://wordpress.org/plugins/ceceppa-multilingua/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Filtrare cpt’ is closed to new replies.