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

Last updated by tejasD 1 week, 6 days ago.

Assigned support staff: Bruno.

Author Posts
September 26, 2019 at 1:49 pm #4647363

tejasD

We have created a custom post type () and custom taxonomy using the CPT plugin. In the custom taxonomy, we have created multiple terms.

In the custom post type, we have assigned multiple terms to the single post. We need the post link with the taxonomy slug included in the URL. So we have applied the rule in the function.php file.

So the post link should be working with multiple taxonomy URLs.

EX. Taxonomy Terms:- Implode, Explode

Post name with the first term URL:- hidden link
Post name with the second term URL:- hidden link

This is working in the WordPress installation without WPML but with WPML plugin it is not working.

Thanks

September 26, 2019 at 7:16 pm #4649941

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. What URL setting are you using to make the URL appear this way? Are you using any special settings for this?

Also, what are the steps I should take to try to replicate the problem?

Please, what is the version of WPML and WP are you using? I would like to know more about your installation. Can you please provide your WPML Debug information in the debug field below? http://wpml.org/faq/provide-debug-information-faster-support/

Thank you.

September 27, 2019 at 6:31 am #4651869

tejasD

Thanks for Reply,

1) What URL setting are you using to make the URL appear this way?
>>> Yes, We have added post type link of a filter and rewrite rule of action. So, please see below the screenshot. hidden link

2) Are you using any special settings for this?
>>> Yes, We have Created custom rewrite slug.

Team (post type):- hidden link
Team Categories (Taxonomy):- hidden link

3) Also, what are the steps I should take to try to replicate the problem?
>>> Please follow below the steps.

1) We have created Custom Post and Taxonomy. Link Team and Team Categories.
2) Then after created terms. Ex: Team1, Team2 hidden link
3) Create a new post and select terms. hidden link

Currently, that was Created post URL ( hidden link ). But we can change term URL slug ( term2 replace to term1 ) on the below URL. but it not working and redirect to the term2. please see the video. hidden link

We have disabled the WPML plugin. it is working properly. hidden link

4) Please, what is the version of WPML and WP are you using?
>>> WP version 4.9.11 and WPML version 4.2.6.

Thanks

September 28, 2019 at 12:27 am #4656949

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you. I saw the problem you are reporting. I have forwarded the issue you are reporting to 2nd tier support so they can check what may be happening.

Once they check the problem, I'll keep you updated.

Thank you.

October 2, 2019 at 11:28 am #4679771

tejasD

I think your teams are working on this problem. But Please give me a feedback as soon as possible.

October 2, 2019 at 10:26 pm #4683409

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Sure. As soon as 2nd tier support verifies this I will contact you.

Thanks.

October 4, 2019 at 3:33 pm #4697057

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

The 2nd tier support added the code below to fix the problem:

function mytheme_do_not_redirect_city_post_type( $redirect, $post_id, $query ) {
    if ( 'team' === $query->get( 'post_type' ) ) {
        return false;
    }
    return $redirect;
};
add_filter( 'wpml_is_redirected', 'mytheme_do_not_redirect_city_post_type', 10, 3 );

You must add this code to the functions.php file of your theme. You can add this below the code you posted in the screenshot above.

Please, let me know if I can help with any other questions you may have about it. I'll be happy to help.

Thank you.

October 9, 2019 at 5:14 am #4719555

tejasD

My issue is resolved now. Thank you!