<sup> tags not activating in header slider

Hi,

We are trying to use [sup] [/sup] (not square brackets ovbiously but won’t display here otherwise) tags in header slider titles to correctly place registered trademark symbol, on Sydney theme, but they are simply displaying as part of the text. Any ideas why this is the case?

Thanks

Hello there,

For security reason, HTML tags aren’t allowed in the main slide title input. The alternative solution is with jQuery code. The easiest way is the below 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($) {

      $( '.slide-item:nth-of-type(1) .slide-inner .text-slider .maintitle' ).html('My slide title 1 with <sup>SUP</sup>');
      $( '.slide-item:nth-of-type(2) .slide-inner .text-slider .maintitle' ).html('My slide title 2 with <sup>SUP</sup>');
      $( '.slide-item:nth-of-type(3) .slide-inner .text-slider .maintitle' ).html('My slide title 3 with <sup>SUP</sup>');
      $( '.slide-item:nth-of-type(4) .slide-inner .text-slider .maintitle' ).html('My slide title 4 with <sup>SUP</sup>');
      $( '.slide-item:nth-of-type(5) .slide-inner .text-slider .maintitle' ).html('My slide title 5 with <sup>SUP</sup>');

    })(jQuery);
  1. Update

Regards,
Kharis

Thanks for the reply. I have followed the instructions, but same as before. I’m wondering if it is something to do with the string translations on Polylang because although that javscript is there the titles haven’t changed at all?

Try flushing any applied cache https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens. It might be preventing the recent code addition to take effect.

Regards,
Kharis

Thanks for the suggestion. I have tried clearing caches, but that doesn’t appear to make a difference. I upgraded to Sydney Pro yesterday. Long shot, but would that make a difference in code required? Is there anything else I could try?

Hello there,

What type of slider do you use? Mind sharing a link to your site here to allow me inspecting it directly?

Regards,
Kharis

Hi,

The slider being used is the default Sydney Pro (previously Sydney) one.

Site is…

Thanks

Hello there,

I found the text slider is stopped. You should have to use this code:

    ;(function($) {

      $( '.text-slider-stopped .text-slider .maintitle' ).html('WE ARE LARHN <sup>&copy;</sup>');
      
    })(jQuery);

Regards,
Kharis

Hi,

That appears to fix one problem but unfortunately creates another as it would seem to override any string translation within Polylang for the various languages on the site, such they all display what is written in that code snippet. Is there a simple workaround for this?

Really appreciate the help so far.

Yes, you’re right.

For other alternative. Firstly add a “/R/” without quotes at the end of your slide title.

21

Then use the below jQuery code to replace it with a trademark symbol.

;(function($) {

  $( '.text-slider-stopped .text-slider .maintitle' ).html(function(index,html){
    return html.replace('/R/','<sup>&reg;</sup>');
  });

})(jQuery);

Apply the code above with the TC Custom JavaScript plugin.

Regards,
Kharis

Afterwards, you’d need re-translate the slide title as new string added (/R/).

Regards,
Kharis

Thanks, issue fixed.

Great!

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