Problem with Polylang on posts
-
Post list had problem on my page with Polylang, in default language returned nothing, but on second language showing both languages.
I modified function to query post as followsfunction sbwpes_sitemap_post() { ?> <h2><?php _e('Products', 'easy-sitemap' ); ?>:</h2> <ul class="sitemap"> <?php $loop = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 1000, 'orderby' => 'title', 'order' => 'ASC' ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <li><?php the_title( '<a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a>' ); ?></li> <?php endwhile; ?> </ul> <?php } add_shortcode( 'SitemapPost', 'sbwpes_sitemap_post' );
- The topic ‘Problem with Polylang on posts’ is closed to new replies.