Superscript for ® symbol

Hi there,

I managed to fix one superscript question based on an old answer on this forum (thank you!), but I have a few more and wondered if you could help. The page in question is (https://www.patentsrock.com, which redirects to https://www.russellip.com/patents-rock/). I’d like to make the following “®” symbols superscript but am struggling to work out how to do it:

  • The ® after “Patents Rock” in the menu bar at the top of the page (applies to other pages on the site too).
  • All other instances of ® on that page (e.g. in the main “Patents Rock®” heading, and with “Patents Rock®”, “Sound IP®” and “Rockin’ Patents®” later down the page.

Any help would be hugely appreciated.

Thanks!

Hello,

First thanks for using our theme!

However, I am a bit confused with your question when you say “superscript the ®”. You want to make the symbol a bit smaller, that’s it?

Kind Regards,

Rodrigo.

aThemes Support

Thanks. Yes, smaller and up in the air. I’ve managed to do this after “Intellectual Properly” on my home page here https://www.russellip.com.

Hello,

I understood now! Thanks!

Please try following the instructions below:

  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($){

        $('span, li.menu-item > a, h2').each(function(){
            var text = $(this).text();

            if( text.indexOf('®') > 0 ) {
                var position  = text.indexOf('®'),
                    textalone = text.substring(0, position ),
                    newtext   = textalone + '®';

                $(this).html( newtext );
            }
        });

    })(jQuery);


We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Thanks so much!

I tried the code and it doesn’t seem to work.

I’m not certain if it’s the cause of the problem, but in your code the final ® is a superscript and when I copy into TC Custom it seems to be ‘standard’ (i.e. not superscript). Perhaps TC Custom doesn’t allow superscript characters or perhaps I’m doing something wrong?

Hello,

Sorry I sent the code without the <sup> tag. Please try with this new code below:

(function($){

    $('span, li.menu-item > a, h2').each(function(){
        var text = $(this).text();

        if( text.indexOf('®') > 0 ) {

            var position  = text.indexOf('®'),
                textalone = text.substring(0, position ),
                newtext   = textalone + '<sup>®</sup>';

            $(this).html( newtext );
        }
    });

})(jQuery);

Note the <sup> tag now.

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Oh wow. That’s absolutely amazing. You’ve literally made my day!

It seems to work perfectly across the whole site on desktop, but doesn’t seem to have worked on mobile. Is there anything I could do about that?

Massive thanks again!

Hello,

You are welcome!

I did a test here and the code should works for mobile too. Maybe you need to clear your website and browser cache to see the new changes.

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support