Crelly Slider & Multi Language site

I am using Sydney Pro with Crelly Slider on my site: po-wisle.pl
The site will be in 3 or 4 languages using Polylang plugin.
All seem to be pretty fine excel Crelly Slider translation.

I cannot find the way to translate the text on it and integrate with website changing languages mechanism. One slider, defined in the Header Area appears on all langues selection.

Your suggestion how to achieve multi language in Crelly Slider will be appreciated.

Dear Athems support,
Any idea how to approach this ?
How can I understand that other topics posted on support forum have attention and this one seem to be alone…
I have purchased Sydeny Pro theme and would be happy if anybody give me hint how to solve my challenge.

If Sydney Pro, based on Polylang add-on could detect which language is selected and based on that start defined Crelly Slider that we will fine. I could then create one slider per langauage.

Any other idea ?

Hello there,

I would like to apologize in advance for the delayed respond.

If Sydney Pro, based on Polylang add-on could detect which language is selected and based on that start defined Crelly Slider that we will fine. I could then create one slider per langauage.

Indeed, this is the most reliable approach. Try to install and activate the Polylang Conditional plugin. This plugin allows us to detect the current active language, and display something under it.

To display the Crelly Slider per language, try to edit the inc/slider.php file. Then find the following code:

crellySlider($alias);

Replace it with the following:

if( is_language( 'af' ) ){
  crellySlider('alias_1');
}

if( is_language( 'ak' ) ){
  crellySlider('alias_2');
}

if( is_language( 'sq' ) ){
  crellySlider('alias_3');
}

Adjust it to your own.

af is the language slug of Afrikaans. You can see the complete list of the language slugs here (GlotPress column).

As you are editing the core theme’s file, you should take it at your own risk. Updating the theme will override the modifications you have made.

Regards,
Kharis

Thanks a lot Kharis.
This is what I did following your advise:
I have installed and activated Polylang Conditional from there https://github.com/JoeHana/polylang-conditional

In the wp-content/themes/sydney-pro-ii/inc/slider.php file I have found the following section:
is_front_page()) ) {
$alias = get_theme_mod(‘rev_alias’);
if ($alias && function_exists(‘crellySlider’)) {
crellySlider($alias);
}

I did replacement (with my best understanding) based on your data and after update the section looks like this:
is_front_page()) ) {
$alias = get_theme_mod(‘rev_alias’);
if ($alias && function_exists(‘crellySlider’)) {
is_language( ‘pl’ ){
crellySlider(‘home1_pl’);
}

	is_language( 'en' ){
	  crellySlider('home1_en');

}

And when I put changes file in the same location then my main page give the following error:
Parse error: syntax error, unexpected ‘{’ in /home/users/powisle/public_html/wp-content/themes/sydney-pro-ii/inc/slider.php on line 130

I do not know php so I do follow “blindly” your advices… :slight_smile:
I do kindly appreciate your further support on this challenge.

Best Regards

Hello there,

Pleas post all of the code in that file here http://gist.github.com. Then share its URL here.

Regards,
Kharis

Here is the updated file:

Hello there,

Apologies, I made a mistake in my previous code.

Try to update the inc/slider.php file with this one.

Let me know how it goes. I’ll wait to hear back from you regarding your stats.

Regards,
Kharis

Thank you Kharis,

This works perfectly as it should !!!

If possible I would suggest to somehow integrate such functionality for future in the permanent theme options.

Do I understand correctly that every theme update might overwrite slider.php file so I need to be careful and potentially change it again ?

Thank again and you may set this topic as RESOLVED !

Cheers,
Maciek

If possible I would suggest to somehow integrate such functionality for future in the permanent theme options.

I don’t know exactly. I thought that it isn’t reliable. But I’ll forward it to our developer. If it meets his fit, I believe it will be integrated in the future version.

Do I understand correctly that every theme update might overwrite slider.php file so I need to be careful and potentially change it again ?

Yes, you must do this adjustment again once the theme gets updated in the future.

Regards,
Kharis

Great. Thank you.

Then in order to make a adjustment on every upgrade can you share what was replaced with what and where in this file (so I can repeat it myself next upgrade).
Especially that you mentioned that initial changes of the code were not correct.

Thank you in advance !

Find and replace this line crellySlider($alias); with the code like


if( is_language( 'af' ) ){
  crellySlider('alias_1');
}

you have added.

Regards,
Kharis

PERFECT !

Thank you.

This very nicely RESOLVED.

Hi Kharis,

Thank you for helping us. I followed your instructions, but the home page stopped at the pre-load animation. I don’t know if I made any mistake or the plug-in (Polylang v2.0.11/ Crelly Slider v1.1.1/Polylang Conditional v0.1.0) had been updated this method you created is longer working now?

Hello there,

Please start your own topic as this one has been marked as resolved. To make us easier debugging the trouble, please share the entire code in your slider.php file on https://gist.github.com/ and post the link into it in your thread. Also please share your site’s URL.

Regards,
Kharis

Hello,

It looks like I have simillar problem. On my website: https://www.am-cycling.com/ I have Crelly slider with the link to the shop. I would like to translate link adress based on the language.
Could you help?

Thanks,
Marcin

Hello Marchin,

Try doing the below steps:

  1. Download the .zip package of this plugin;
  2. Install and activate it;
  3. Edit the header.php file of the Sydney Pro template file. You can go to Appearance > Editor. Then replace this line of code:
    <?php sydney_slider_template(); ?>

with:

    <?php sydney_pro_child_sydney_slider_template(); ?>

Save. Please note that, if you edited the parent theme, you should re-do this modification when you update the theme in the future, as all template files are overwritten.

  1. Go to Crelly Slider aministration panel; and duplicate your existing one. Then edit the content/link manually. This new slider will be displayed for other target language.

  2. Go to Appearance > Customize > Crelly Slider; Then enter the new alias for respected target language.

Regards,
Kharisr.

Thanks a lot.
I also found simpler solution for links. When my url is www.am-cycling.com/pl/ and I need to link to www.am-cycling.com/pl/shop/ I use href=“shop/” :slight_smile: It works for both languages.

Great! Thank you for sharing the trick.

You’re welcome! Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis