Forums Forums Search & Filter Pro Search & Filter with WPML

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Trevor
    #139634

    Hi

    It is possible that I have misunderstood you, but I want to be sure before I address the concern.

    The way WPML works is to have posts and taxonomy terms translated, and it keeps each language version separated. You want to be able to select a term (like Certification) and see post results from both languages at the same time by joining Certification with the translated term as well?

    Anonymous
    #139682

    Hi Trever, that is correct. It’s also why I thought I could get away with adding the translated IDs to the page template 151, 348, 419 but that didn’t seem to cut it

    Trevor
    #139831

    It is possible you might achieve this by using the Edit Query Arguments filter, but I do not think it would be easy.

    Other users have posted examples of their own usage in the forums, so it might be worth searching for the filter name:

    sf_edit_query_args

    Anonymous
    #139846

    Thanks, Trevor. I tried adding the following to my functions.php but didn’t see the results I was looking for either.

    function filter_function_name( $query_args, $sfid ) {
      //if search form ID = 100, then do something with this query
      if($sfid==261) {
        //modify $query_args here before returning it
        $query_args = array(
          'post_type' => 'resource-item',
          'suppress_filters' => true,
          'orderby' => 'post_date',
          'order' => 'DESC',
          'tag__in' => array( 151, 348, 419 ),
          'posts_per_page' =>  10
        );
      }
      return $query_args;
    }
    add_filter( 'sf_edit_query_args', 'filter_function_name', 20, 2 );

    I’ve been searching through the forum, and haven’t been able to find an example that includes the tags.

    Trevor
    #139855

    You code looks right to me (but I could easily be wrong).

    What happens if you tell WPML NOT to translate a particular taxonomy? Does it then keep the same terms for all languages?

Viewing 5 posts - 1 through 5 (of 5 total)