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.

Our next available supporter will start replying to tickets in about 5.25 hours from now. Thank you for your understanding.

This topic contains 1 reply, has 1 voice.

Last updated by hishamA-3 2 years, 2 months ago.

Assigned support staff: Bruno.

Author Posts
March 22, 2018 at 2:48 pm #1554020


Hello WPML Support Center,
First, I'd like to thank you for the hard work and effort you spend to help and support your customers,

I am trying to translate a shortcode that I manually added to my template-frontpage after I added the shortcode to the "get_string" function or so it's called , the shortcode already appeared in the WPML String translation, But it was translated to a long string in HTML.

My "get_string" function I added manually to my template-frontpage:-
<?php _e( do_shortcode("[smartslider3 slider=2]"), 'azera-shop' ); ?>

Link to the generated code inside WPML String Translation: hidden link

I tried to translate the generated HTML string by translating the desired text inside of it, but no luck, nothing appears in the translated page, I even just copied the exact HTML and pasted it in the translated string space in WPML String translation, But to no avail, Still nothing is showing on my page.

what I'm trying to do, Is translate "Smart Slider3" Plugin's texts by generating a different slider for each language as you suggested in another ticket "URL under this post",

I did that and I want to insert the shortcode of each slider inside each of my php page templates, the original language template is done fine, But I can't seem to find the translated page or it doesn't even exist!, So how can I add the 2nd language shortcode inside the body of the translated page Manually, I'd really appreciate a way to that, the help and a solution.

URL for the previous ticket:

Thanks in advance, and kind regards,

March 23, 2018 at 4:11 pm #1555264


I found a solution in one of your tickets under the name of something like "conditional shortcode", I thought I'd paste it in, it might help somebody else, who knows.

the solution goes by adding an if statement to the template-page like this:

		if (ICL_LANGUAGE_CODE == 'en') {
			echo do_shortcode("[smartslider3 slider=2]"); 
		} else {
			echo do_shortcode("[smartslider3 slider=3]"); 

Kind regards,