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

Last updated by Lauren 2 months, 2 weeks ago.

Assigned support staff: Lauren.

Author Posts
July 9, 2019 at 12:32 pm #4170717

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Did you change the URL format? And if so, did this resolve the issue for you?

July 9, 2019 at 12:35 pm #4170759

alexanderA

Sorry, maybe I wasn't clear in my previous message. Let me back up. In your previous message, you said,

>> Please change permalink structure in WPML > Languages > Language URL format to Different languages in directories and please let me know if that resolves the issue.

I planned to do this. But when I opened WPML > Languages, "Language URL format" was already set to "Different languages in directories." Furthermore, I am quite sure "Different languages directories" has been set for many years now--since I first installed WPML--and has never been changed.

July 9, 2019 at 3:36 pm #4172595

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Okay thanks for testing that for me. That resolved it on the test site, so let me get back to the developers to let them know it did not work in your situation. I'll update here as soon as I have more information. Thanks for your continued patience.

July 10, 2019 at 8:10 am #4177123

alexanderA

Great thanks.

July 10, 2019 at 12:15 pm #4180005

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

You are welcome. I hope to have an update soon.

July 12, 2019 at 4:13 pm #4200425

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Please set <custom-field action="copy-once">ale_assigned_agent</custom-field> to copy-once. You can add this in WPML -> Settings -> Custom XML Configuration. You would add this:

<wpml-config>
<custom-fields>
<custom-field action="copy-once">ale_assigned_agent</custom-field>
</custom-fields>
</wpml-config>

Then, add the following code to theme functions.php:

function translate_agent_id( $post_id ) {
    $meta_key = 'ale_assigned_agent';

    $agent_id = get_post_meta(  $post_id, $meta_key, true );

    update_post_meta( $post_id, $meta_key, apply_filters( 'wpml_object_id', $agent_id, 'agents', true ));
}

add_filter( 'save_post', 'translate_agent_id', 999 );

After these steps, please resave the posts and then they should display.

Please let me know if this resolves the issue for you.

July 13, 2019 at 7:54 am #4203095

alexanderA

>> After these steps, please resave the posts and then they should display.

OK. But are you saying I need to manually open each post, then re-save it, in order for it to display?

July 13, 2019 at 10:39 am #4203281

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

You can try doing a bulk update. To do this, click on Pages in your dashboard to view a list of your pages. Then, select all and from the bulk option drop down list, click Update. Then, when the first page opens, click Save or Update. This will update all of the selected pages. Next, use the admin language switcher at the top to change languages and repeat this for your secondary language(s).

Hopefully, this will work so that you don't need to open each one and save.

July 15, 2019 at 9:37 am #4209253

alexanderA

>> You can try doing a bulk update. To do this, click on Pages in your dashboard to view a list of your pages. Then, select all and from the bulk option drop down list, click Update.

OK. But are you sure I should click 'Pages?' In my case, I want to display posts--specifically of custom post type 'properties.' If so, when I click Dashboard-->Properties, I can select all. But there is no 'Update' option (see attached screenshot). Thoughts?

July 15, 2019 at 1:46 pm #4211755

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Yes, you should do the same steps for Posts and from that drop down menu, select "Edit".

July 15, 2019 at 3:06 pm #4212647

alexanderA

OK I see. But when I select all, it only selects the posts displayed on the screen, which is 15 posts. But in total I have ~450 posts. How can I truly 'select all?' Do I have to first modify 'Screen Options' to ensure all 450 posts are displayed at once?

July 15, 2019 at 6:01 pm #4213943

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Yes, you can use the screen options to change the number that you can see. I recommend doing it in batches though, as you might run into trouble if you try to do them all at one time.

July 16, 2019 at 10:52 am #4219371

alexanderA

OK here is what I tried:

1. Added the code to Custom XML Configuration.
2. Added the code to functions.php.
3. Opened one single post for editing--the English version of the post.
4. Saved the post.
5. Opened the FR version of the Agents page, but there were still zero posts displayed.
6. Opened the FR version of the same post. Saved it.
7. Refreshed the FR version of the Agents page, but there were still zero posts displayed.

Thoughts?

July 16, 2019 at 3:11 pm #4221581

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I logged in to your site and updated one property in English ((HS0633 - Choeng Mon) and then I updated the property in French. I can now see the listing displayed correctly for the French agent here:
hidden link

Which property did you update in both languages that you are not seeing the listing for?

July 16, 2019 at 4:23 pm #4222289

alexanderA

OK I see the property you updated, and see that it now displays on that particular FR agent page. The property I updated was:

hidden link

I updated it in EN and FR. The agent was set to "Craig Beechey," and his FR agent page is:

hidden link

But the property doesn't display. Thoughts?