Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by MWEB 5 years, 5 months ago.

Assigned support staff: Dat Hoang.

Author Posts
June 19, 2016 at 12:39 pm #918640

MWEB

Hello,

In my sidebar i have a code for creating a arhive list which is working on main language (Serbian) hidden link but when I choose Egglish nothing is shown hidden link All posts are translated, but problem is to show wp_get_archives Code is;

<ul>
<?php $args = array(
type'            => 'monthly',
'limit'           => '',
'format'          => 'html', 
'before'          => '',
'after'           => '',
'show_post_count' => false,
'echo'            => 1,
'order'           => 'DESC'
);
wp_get_archives($args); ?>
</ul>

It work fine for Serbian, but nothing is dispayed for English.

Similar problem is to display tags. Working for Serbian language but not for English

<?php $query_args = array('category__in' => array(47,48,49,50,51),'posts_per_page' => -1 );?>
					    <?php $query = new WP_Query( $query_args );
					    	$posttags = "";
					    	while( $query->have_posts() ) {
					      	$query->the_post();
					        	if( get_the_tag_list() ){
					          		$posttags = $posttags . get_the_tag_list('',',',',');
					        }
					    }

					    wp_reset_postdata();

					    $sortedtags = explode(',', $posttags);
					    asort($sortedtags);
					    $sortedtags = array_unique($sortedtags);
					    $sortedtags = array_values( array_filter($sortedtags) );

					    foreach ($sortedtags as $tagname) {
					      echo '<li>' . $tagname . '</li>';
					    }

					?>

Can you please help me with this issue?

June 20, 2016 at 1:06 pm #919887

Dat Hoang

#1,
You're using WPML Translation Management 2.1.6. This version is out-of-date. Please update the latest version 2.2.0 that works fine with WPML 3.4.0.

#2,
For the first code "wp_get_archives", I tested in my site and it's working fine. I needed to modify this line with the wrong syntax as well:

From:

type'            => 'monthly',

To:

'type'            => 'monthly', /// missing the first single quote.

Please check your site again, make sure that you translate all your posts into English?

#3,
If you disable all non-related WPML plugins, switch to one of default themes, the problem persists or not?

NOTE:
+ Make a backup (both files and database) for your site before updating/proceeding anything (Always a good practice!).

--------

In this ticket, I'm focusing on the issue with "wp_get_archives"
Please open another ticket for "get_the_tag_list". In each ticket, we focus on only one problem. That helps others with the same problem find the solution quickly.
If you want, you can assign the ticket or ask me to support you in the new ticket.

June 22, 2016 at 7:42 am #923767

MWEB

Hello Dat,

Thank you your your reply. I have found a mistake. Problem was in function.php hidden link I totaly forgot on this part of code, which I filter archive only to specific category with ID 4. I putted if filter and now works fine.

Tnx, I will open new ticket for get_the_tag_list.