Using WPML and Dynamic Content - Getting the Post Title in Current Language

Hi there,

First off I really love the loopers and dynamic content function of the theme it has made development a lot easier! But I have run into a problem - so I have buttons on a page and its permalink and text are dynamic content. The link works well, the page title translate perfectly when it’s on it’s own page. But the buttons when trying to call the post title - it just grabs the English post title even though its translated and even though it is on the translated language’s side.

So for my button my Primary Text is: Go to {{dc:post:title post=“31”}}

Any assistance would be appreciated!

Hi Shelley,

Thank you for reaching out to us. To better assist you with your issue, please get back to us with the URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post so we can take a look at your setup.

Thanks!

Hi Nabeel!

Sorry I was away all of last week - just added the Secure Note. An example of the where this happens is on this page: https://dev.canadiancentreforaccreditation.ca/?page_id=21

You can see the buttons in the callouts near the bottom of the page. If you toggle to French they don’t get translated.

Thanks,
Shelley

Hi Shelley,

The reason why the callouts buttons are still outputting the English version of the text because you are calling the wrong page while you are editing it as French. To explain further, please check the details below.

One of your buttons links goes to https://dev.canadiancentreforaccreditation.ca/accreditation-with-cca/overview-of-accreditation/

the page ID of that page in English is 22 while in French it is 676.

If you are asking where can find the page ID, just click the edit page
image

Then in the link, you can see the post id

.

To fix your issue, just change the post id in your french version.

One more thing, I see that you had an issue with permalinks while using the post name. So what I did is change your permalinks from plain to post name and then added a code in .htaccess so that your permalinks while setting to post name will work. You can check below the code I added to your website.

Hope that helps.

Thank you.

Thanks @marc_a - for finding this fix and also fixing my permalink issue on top of that!

HI Shelley,

You’re welcome and it’s our pleasure to help you! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.