-
AuthorPosts
-
September 17, 2018 at 1:58 pm #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ünterSeptember 17, 2018 at 6:25 pm #1010895Hey 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,
PeterSeptember 18, 2018 at 6:52 am #1011109Hi 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ünterSeptember 18, 2018 at 7:57 am #1011124Hey!
Great, glad I could help you :)Best regards,
Peter -
AuthorPosts
- You must be logged in to reply to this topic.