Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using WPML for multi-language website. It works really well except for custom taxonomies.

In admin, I can only join foreign posts to foreign taxonomies (which is exactly what it should do) but on the public area, when retrieving taxonomies it seems that the current language is ignored: I get all taxonomies.

Any help would be greatly appreciated !

Thanks.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I found out that when retrieving the taxonomy you have to do this :

    $args = array(
        'hide_empty' => true,
        'taxonomy' => 'projet_thematique'
    );
    $thematiques = get_terms('projet_thematique', $args);

The thing was done by adding the 'taxonomy' as an argument as well.

I hope it will be usefull for others ;)

share|improve this answer

hack for filter the_terms:

$terms = get_terms('YOUR-TAXONOMY','hide_empty=1' );
if (!empty( $terms )){
  $term_links = "";
  foreach ( $terms as $term ) {
  if($term->term_id == icl_object_id($term->term_id,'YOUR-TAXONOMY',false,ICL_LANGUAGE_CODE)){
    $term_links[] = '<li><a href="'.$category_url.'?YOUR-TAXONOMY='. $term->slug.'">
     ' . $term->name . '' . $term->name . '</a></li>';
  }
  }
echo join( '', $term_links );
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.