Skip Navigation

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

Last updated by Waqar Ali 1 year, 2 months ago.

Assisted by: Waqar Ali.

Author Posts
March 6, 2024 at 2:14 pm #15379932

igorB-4

I have site with 2 languages.

I have set theme builder not to translate, because i have like 25 templates in theme builder.

SO in one i have some items that i would like to have some logic to display them only on ENG page.

How would i go about that, without having 2 sets of 25 templates to maintain.

March 7, 2024 at 8:26 am #15382617

Waqar Ali

Hi,

Thank you for contacting us and I'd be happy to assist.

For partial or segment-based translations, you can use the 'wpml-string' shortcode:
https://wpml.org/documentation/support/wpml-coding-api/shortcodes/#wpml-string

For example:


[wpml-string context="my-domain" name="block-number-1"]
<p>Content coming from block line 1</p>
<p>Content coming from block line 2</p>
<p>Content coming from block line 3</p>
[/wpml-string]

After adding this content block to your template, you can visit the front-end page that uses this template, so that this can be picked up by the WPML string translation feature.

It will then be available to be translated into other languages, through WP Admin -> WPML -> String Translations.

regards,
Waqar