Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1010752
    • I have two language versions (DE, EN)
    • The languages are managed by Polylang plugin
    • Posts and categories are unset from beeing translated by Polylang

    On Homepage I have a section
    [av_blog blog_type='posts' categories='54,14' link='category' blog_style='blog-grid' columns='3' contents='title_read_more' content_length='content' preview_mode='auto' image_size='portfolio' items='6' offset='0' paginate='yes' conditional='' av-medium-hide='aviaTBav-medium-hide' av-small-hide='aviaTBav-small-hide' av-mini-hide='aviaTBav-mini-hide' av_uid='av-57b0vi']
    In the translation (EN) no posts are displayed. When I use the “normal style”
    [av_blog blog_type='posts' categories='54,14' link='category' blog_style='single-big' …
    the (German) posts are shown on the english page. But with the blog-grid it does not work.
    How can I display the posts in the English page in grid style? Is there a different query?

    Best regards,
    Günter

    #1010895

    Hey Günter,

    According to the polylang docs ( https://polylang.pro/doc/developpers-how-to/ – section “How to query content in a different language than the current one”) you can use the lang parameter to query the German posts.

    You can use this code in your child theme functions.php to adjust the query

    
    add_filter('avia_post_slide_query', 'avia_post_slider_custom_query', 10, 2);
    function avia_post_slider_custom_query( $query, $params ) {
    	$query['lang'] = 'de';
    	return $query;
    }
    

    If this code doesn’t work please talk to the plugin developers because we officially only support WPML and they can use the code above as a starting point if other query parameters are required.

    Best regards,
    Peter

    #1011109

    Hi Peter,

    I have seen that polylang “how to”, but I did not know how to integrate the lang parameter into the query. Your code lines solved my problems!

    Thank you very much for your help!
    Günter

    #1011124

    Hey!
    Great, glad I could help you :)

    Best regards,
    Peter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.