Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

jeffkono on "[Plugin: Polylang] Sticky posts not showing in second language"

$
0
0

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.

https://wordpress.org/plugins/polylang/


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>