Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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 9 replies, has 3 voices.

Last updated by paulL-22 11 months, 4 weeks ago.

Assigned support staff: Bigul.

Author Posts
February 11, 2019 at 1:22 pm #3183073

paulL-22

Hi Bigul,
The website has only 3 sermons and 3 posts. From the original language which is English, we translate them to French. The issue is in the count, you can see that in the files I sent to you. when you are in English or french and you click on "month" or "mois", the count shows 6 instead of 3. In English or in French it should display 3 posts or 3 sermons not 6. That's the issue.

February 11, 2019 at 7:11 pm #3185106

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve these issues.

Please check the attached images, the issue is existing for me in a fresh installation after the initial debugging procedures. Therefore I am escalating the ticket to our compatibility team for further debugging.

We will get back to you as early as possible. Please wait.

--
Thanks!

Bigul

February 12, 2019 at 2:01 am #3185875

paulL-22

Hi Bigul,
I am waiting for the fix.
Thanks.

February 12, 2019 at 6:13 am #3186692

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Thank you for the feedback. Our compatibility team is currently working on this issue. I will get back to you soon when we have an update from our compatibility team on this. Please wait.

--
Thanks!

Bigul

February 14, 2019 at 3:06 pm #3200497

paulL-22

Hi Bigul,
I am still waiting for the fix.

Thanks.

February 14, 2019 at 6:54 pm #3201473

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

For your kind updates, this issue is happening because of the *Saved* theme codes. The theme is using custom queries to list the posts/custom post type posts and its count.

So our developers cross check it once again and may our compatibility team will contact the theme author soon. I will get back to you soon when we have an update on this. Please wait.

--
Thanks!

Bigul

February 18, 2019 at 5:24 pm #3213546

paulL-22

Hi Bigul,
What's going on? I have been waiting for a fix for so long.
Could you tell me what did the theme author tell you?
Please, I need an update.

Paul

February 19, 2019 at 7:23 am #3215263

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Since Bigul currently has a few days off, I will replace him here in the forum. I hope this is OK for you 🙂

I checked the internal escalated ticket and our team is still checking the issue, I will ask for an update there and will update you as soon as I will have any feedback.

Thanks

February 21, 2019 at 2:08 pm #3227847

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Paul,

I am back to this ticket. For your kind information, it works on our local copies after our compatibility team has rewritten the Query using for listing Post archives count.

Please try the following steps after a full site backup and make sure the issue is existing or not.

1) Visit *wp-content/themes/saved/framework/includes/* folder
2) Open *archives.php* file for edit
3) Scroll down to line 252
4) Replace the custom query line from 252 to 271 like the following

From

$archives = (array) $wpdb->get_results( $wpdb->prepare(
		"
			SELECT
				YEAR(post_date) AS `year`,
				MONTH(post_date) AS `month`,
				count(ID) as posts
			FROM $wpdb->posts
			WHERE
				post_type = %s
				AND post_status = 'publish'
			GROUP BY
				YEAR(post_date),
				MONTH(post_date)
			ORDER BY post_date DESC
			$sql_limit
		",
		array(
			$post_type
		)
	) ); 

To

global $wpdb;

	$join = '';
	$where = '';
	if ( apply_filters( 'wpml_setting', false, 'setup_complete' ) ) {
		$join = " LEFT JOIN {$wpdb->prefix}icl_translations ON ID = element_id AND element_type LIKE 'post_%'";
		$where = " AND language_code = '" . apply_filters( 'wpml_current_language', false ) . "'";
	}

	$archives = (array) $wpdb->get_results( $wpdb->prepare(
        "
			SELECT
				YEAR(post_date) AS `year`,
				MONTH(post_date) AS `month`,
				count(ID) as posts
			FROM $wpdb->posts
			$join
			WHERE
				post_type = %s
				AND post_status = 'publish'
				$where
			GROUP BY
				YEAR(post_date),
				MONTH(post_date)
			ORDER BY post_date DESC
			$sql_limit
		",
        array(
            $post_type
        )
    ) );

5) Save the changes

Please update about this change to *Saved* theme team. So we can keep this compatibility code in the future release also.

--
Thanks!

Bigul

February 22, 2019 at 2:42 pm #3232820

paulL-22

My issue is resolved now. Thank you!