Show specific translated post in template regarding of the language
-
Hello, I’m new to wordpress and trying to make my own theme on example of Twenty twelve theme.
In my theme, I have several places where I need to show different posts, I achieved it simply by
<?php $post_id = 26; $queried_post = get_post($post_id); echo $queried_post->post_content; ?>
So far so good, but the problem is that my website is multilingual, I’m using Polylang plugin for that. So obviously posts won’t change to translated one if language is switched.
Maybe someone can give me advice how to make it the right way, so that on correct language the correct post is showed?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Show specific translated post in template regarding of the language’ is closed to new replies.