Hi all,
I have a static page with a custom template serving as the home page of a Polylang-powered bilingual site. I wanted to display only sticky posts on the home page . I'm using the following code (adapted from the Codex) to call the posts:
<?php /* Sticky loop */
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 5,
'post__in' => $sticky,
'ignore_sticky_posts' => 1
);
$wp_query = new WP_Query( $args );
if ( isset($sticky[0]) ) {
while ($wp_query->have_posts()) {
$wp_query->the_post();
get_template_part( 'homefeature' );
}
}
wp_reset_query();
?>
In the default language (Portuguese in this case), all sticky posts show up fine. When I switch to the alternate language (English), no posts appear, though there are proper translated sticky posts.
I assumed the posts from the proper language would load with this code. Am I doing something wrong? I did search for this issue but couldn't find any answer. Any pointers in the right direction are appreciated.