Call to action in new tab

Hi

sorry I have a quick question on an issue I can’t sort out in the Sydney theme:

using the call to action widget there is not an ‘open in new tab’ option, is it possible to do it?
maybe adding something to the ‘Link for the button’ line?

Please note that I did the same question a few years ago and it was well fixed adding a script to the ‘Header and footer Scripts’. Unfortunately this doesn’t seem to work anymore :frowning:

Hope you can help,

Thank you for your kind attention.

Simone

Hi Simone,

I need direct inspection to deal with the button.

Can you share a link to a page you need help with, so I can help you in a better way?

Regards,
Kharis
aThemes Support

Hi Kharis

Please visit matiky.co.uk

The buttons:

‘Give it a look now!’
‘Discover now!’
‘Get inspired here’

They should open in a new tab.

I just realised that on iPad it actually opens the link in the related app (Pinterest).

Looking forward to hearing from you

Many thanks
Simone

Hi

I have notice another detail failing on iPad only:
The images (all of them in any widget or part of the webpage) do not scale properly and they look super pixeled, this happens only with the iPad oriented horizontally, vertical view is perfect.

Any clue on how to fix it?

Thanks again
Simone

Hi Simone,

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

      if( $('.widget_sydney_action .roll-button').length ) {

        $('.widget_sydney_action .roll-button').each(function(){
          $(this).attr('target', '_blank');
        });

      }

    })(jQuery);
  1. Update

Regards,
Kharis
aThemes Support

Please raise a new topics for your other questions. And use one topic for one question to avoid endless threads.

Regards,
Kharis
aThemes Support

Hi

Thanks, I tried but it’s not working.

I also tried deleting the previous scripts in Header and footer plugin settings, no way :frowning:

Hope there’ll be a fix.

Cheers

Simone

Hi Simone,

You have active cache and it may force the web browser to load the cached version of your page. Flush it and try reloading your page.

Adding, you may also need to flush history, cache, restart your web browser.

Regards,
Kharis
aThemes Support

Hi

Tried also clearing cache, restart, no way.

Hi,

Can you try disabling script compression mode, refreshing, and checking your page?

Regards,
Kharis
aThemes Support

Hi Kharis

How do you do it?

Hi,

As checked from the source code of your website, I found you’re using Autoptimize plugin. And you should find the option to disable script compression within the plugin’s settings from your website’s dashboard.

If you can’t find the option, I’d recommend seeking for help at the support channel of the plugin: https://wordpress.org/support/plugin/autoptimize/.

Regards,
Kharis
aThemes Support

Hi

Yes it works but this will make open in new tabs also other buttons that are connected to different sections of the page, and I don’t want those to open outside.

I don’t understand what’s happening, it used to work properly in the past, with only the cta that I wanted opening in new tabs (‘give it a look now!’, ‘discover now!’, ‘get inspired here!’

The other strange thing is that on iPad and iphone the mentioned cta work properly triggering automatically the external app

Hi
Any news or ideas?
Cheers

Can you mention other buttons you’re referring to? Do they appear in the same page? It would be better if you can share screenshots to point me the location.

Regards,
Kharis
aThemes Support

Hi

Please see the images attached with notes on the buttons who need to open in new tab (green note) and the ones to just move down to the specific point of the same page (yellow note).

Hi,

Thank you for sharing the screenshots.

The code above is aimed for the buttons in greeen already, which technically, they have shared .widget_sydney_action .roll-button selector. To confirm this, you can try adding this CSS code to Appearance > Customize > Additional CSS from dashboard for checking.

    .widget_sydney_action .roll-button {
      border: 10px solid green;
    }

Regards,
Kharis
aThemes Support

Hi thanks, but nothing changed.

Regards

Have you flushed cache each time adding some lines of code or applying some changes?

Regards,
Kharis
aThemes Support