Header Slider: Two languages + Call to action button

Hi,

I have two problems i can’t seem to fix

The first problem;

I have two languages on my site (Danish/English(hopefully german in the future)). (note: I use polyang)

In the header slider, I have uploaded a picture with a Danish text informing a sale. This also appears on the English site. Which is generally fine.

The question is; Is it possible to have an image only appear on Danish and one only on English

The second problem;
Is that I want to direct my audience to that sale on the first slide. But have no call to action on the other slides

I don’t know if you need to see the problem? If needed here’s the site; http://autismwhisper.com/

Thank you in advance.

  • Fiemus

Hello there,

You can add a new slide item and limit its visibility in a specific page with a couple of jQuery code. Please try doing these steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    (function($){

      $.fn.addHeaderSlider=function(i){var e=$.extend({imageUrl:"",mainTitle:"",subTitle:"",buttonURL:"",buttonText:""},i),t='<div class="slide-item" style="background-image:url(\''+e.imageUrl+"')\">";t+='<img class="mobile-slide preserve" src="'+e.imageUrl+'" />',t+='<div class="slide-inner custom-slide-inner"><div class="contain animated fadeInRightBig text-slider">',t+='<h2 class="maintitle">'+e.mainTitle+"</h2>",t+='<p class="subtitle">'+e.subTitle+"</p>",t+='</div><a href="'+e.buttonURL+'" class="roll-button button-slider">'+e.buttonText+"</a></div>",t+="</div>",""!=e.imageUrl&&this.find(".slides-container").prepend(t)};

      /* Add new firts slide for specific pages */

      $('.page-id-3367 .header-slider').addHeaderSlider({
        imageUrl: 'http://autismwhisper.com/wp-content/uploads/2018/01/NU-P%C3%85-TILBUD-1.jpg',
        mainTitle: 'Slide title',
        subTitle: 'Slide subtitle',
        buttonURL: '#more',
        buttonText: 'My Button',
      });

      $('.page-id-3753 .header-slider').addHeaderSlider({
        imageUrl: 'http://autismwhisper.com/wp-content/uploads/2018/01/NU-P%C3%85-TILBUD-1.jpg',
        mainTitle: 'Slide title',
        subTitle: 'Slide subtitle',
        buttonURL: '#more',
        buttonText: 'My Button',
      });


    })(jQuery);

In the code above .page-id-3367 is page ID of your home page.

4 . Update

Regards,
Kharis

First of, sorry for the late answer :grimacing:

Second, I have child-theme of Sydney, can I insert this code into WordPress’s editor instead? Question is, should I put this code into header.php?

Thank you for the help!

Fiemus

Hello Fiemus,

No problem.

As the type of code I’ve suggested is JavaScript, you should add it with the TC Custom JavaScript plugin. No need to edit the theme’s files.

Regards,
Kharis

Great!

Thank you for service, it is exceptional every time

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

If you don’t mind, could you please rate our Sydney theme here? We would highly appreciate it if you do so.

Regards,
Kharis