Answer the question
In order to leave comments, you need to log in
Wordpress + WPML. How to edit blog.php to display correctly in a multilingual site?
Good afternoon, stuck in one issue on an unfinished website. Given: A
site on wordpress with a multilingual WPLM plugin, we are interested in the "Blog" section only in two languages RU and EN.
the Russian version is now the
English version
. They display the same thing, all the entries are mixed - Russian and with translation.
Here I ask for help, how to split the display - so that in Russian blogs there are only Russian posts, and in English. - translated.
I'm assuming it's all in the blog.php template. I tried to rule, but my knowledge is not enough.
blog.php posting:
<?php
/* Template Name: Blog page */
?>
<?php get_header();?>
<?php instant_breadcrumb(); ?>
<?php _e( 'Blog', 'baliwave' ); ?>
<?php wp_nav_menu( array( 'container' => '', 'theme_location' => 'secondary', 'fallback_cb'=> '', 'menu_class' => 'blogmenu', 'echo' => 1 ) ); ?>
<?php $posts = get_posts(array(
foreach($posts as $post){ setup_postdata($post); ?> <?php the_title();?>
<?php
$category = get_the_category();
?>
Posted by <?php the_author(); ?>
?> <?php the_excerpt();?>
'numberposts' => -1,
'offset' => 0,
'category' => '',
'orderby' => 'post_date',
'order' => ' DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value'
<?php _e( 'More details', 'baliwave' ); ?>
<?php } wp_reset_postdata(); ?>
<?php get_footer();?>
Now it just prints all existing blog posts onto the page.
Thanks for the help!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question