Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are experiencing an issue with the WPML plugin where the slug in the URL is being incorrectly assigned as ***_trashed.
Solution:
We recommend you go to your theme's

functions.php

file and remove or comment out the specific code that might be causing this issue. Here is the code you should look for:

function aryaka_archive( $query ) {
 
if (!is_admin()) {
  $query->set( 'post_status', array( 'publish') );
}   
 
 if ( !is_single() ) {
 if (! is_admin() && $query->get( 'post_type' ) == 'press_release' && get_query_var('year') == 0 ){  
  $query->set('date_query', array( array( 'after' => 'January 1st, 2017', 'inclusive' => true,)) );
  $query->set( 'post_status', array( 'publish') );
 } 
}
 
if (! is_admin() && $query->get( 'post_type' ) == 'news_article' && get_query_var('year') == 0 ){    
    $query->set('date_query', array( array( 'after' => 'January 1st, 2017', 'inclusive' => true,)) );
}
 return $query;
};
add_filter('pre_get_posts', 'aryaka_archive');

If this does not resolve the issue, try switching to a default WordPress theme to see if the problem persists.
For similar issues, you can check this forum thread.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Shekhar Bhandari 4 months, 2 weeks ago.

Assisted by: Shekhar Bhandari.

Author Posts
August 21, 2024 at 9:58 am #16089564

bhavani-shankarS-2

Background of the issue:
I am experiencing an issue with the WPML plugin on my site hidden link. I have encountered a problem with the slug in the URL being assigned as ***_trashed.

Symptoms:
The slug in the URL is being assigned as ***_trashed.

Questions:
Why is the slug in the URL being assigned as ***_trashed?
How can I resolve the issue with the slug being assigned as ***_trashed?

August 21, 2024 at 11:58 am #16090230

bhavani-shankarS-2

I am waiting for your reply 🙂

August 21, 2024 at 12:23 pm #16090370

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

Go to your theme functions.php and remove/comment out the following code:

function aryaka_archive( $query ) {

if (!is_admin()) {
  $query->set( 'post_status', array( 'publish') );
}	

 if ( !is_single() ) {
 if (! is_admin() && $query->get( 'post_type' ) == 'press_release' && get_query_var('year') == 0 ){	
  $query->set('date_query', array( array( 'after' => 'January 1st, 2017', 'inclusive' => true,)) );
  $query->set( 'post_status', array( 'publish') );
 } 
}

if (! is_admin() && $query->get( 'post_type' ) == 'news_article' && get_query_var('year') == 0 ){	
	$query->set('date_query', array( array( 'after' => 'January 1st, 2017', 'inclusive' => true,)) );
}
 return $query;
};
add_filter('pre_get_posts', 'aryaka_archive');

and see if it helps, if not, I suggest you to use a default WordPress theme and see if it helps.

Similar issue: https://wpml.org/forums/topic/hi-there-i-am-seeing-a-number-of-issues-with-wpml-and-acf-pro/

Look forward to your reply.

Thanks

August 21, 2024 at 12:41 pm #16090411

bhavani-shankarS-2

sure, i am doing now

August 21, 2024 at 12:47 pm #16090438

bhavani-shankarS-2

how do i know this issues got fixed?

August 21, 2024 at 12:53 pm #16090510

bhavani-shankarS-2

i have removed the code which you suggested, can you please review the issues now?

August 22, 2024 at 4:39 am #16092545

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

I tested with the page and couldn't see the issues. hidden link

I suggest you to rename the trashed page slug and see if reverts back in few days to test this.

Thanks

August 23, 2024 at 11:06 am #16098329

bhavani-shankarS-2

Thank you so much