Can you make the "Call to action button" open a new tab?

The front page, main photo, has a “Call to action button” listed in Customize, but when someone clicks on it, is it possible for it to open that link to “Open Link in a New Tab”?

Thanks:)

Hello there,

In order to achieve that objective, could you please try to do the following?

  1. Install and activate the Header and Footer Scripts plugin
  2. Go To Settings > Header and Footer Scripts panel
  3. Paste the following code into the provided “Scripts in footer:” box

<script type="text/javascript">

  jQuery(function($) {

   if( $('.button-slider').length ){

      $('.button-slider').attr('target', '_blank');
      
    }
    
  });

</script>

This code only works if your button URL doesn’t contain something like #primary.

  1. Save settings

Regards,
Kharis

Works perfect Kharis, thanks again :slight_smile:

Hello,

I am using the call to action button on a section of my site, not on the header or footer. It is possible to get the button to open a modal popup when clicked. I would like to get users to fill a form when the button is clicked. I have already set up a modal popup with a form but I am not sure how to link this to the call to action button.

Please help.

Thanks.

Hello there,

> I have already set up a modal popup with a form …

What jQuery library are you using? Is there any link where I can download it, so I could try integrating it on my test site. I would post the tutorial here, If it possible to do with it.

Regards,
Kharis

Hello Kharis,

Am not using a jQuery Library, just a wordpress plugin (Easy modal plugin). I can see the html for the call to cation button when I view the source for the site on my browser. I need to attach the class for the modal to the href of the button, but I don’t know how to edit the html for wordpress.

Here is the link to my site, it might help you understand better.

http://testsite.trishaomabu.com/about-us/

I’d appreciate if you can help me with a way to edit the html or any other ideas you can think of to achieve the modal popup.

Thanks
Trisha

Dear Trisha,

Is this the download page of the plugin you are using?

Regards,
Kharis

Yes, That’s the one.

Hello there,

I thought you should follow this tutorial. In the “Extra CSS Selectors” input field, enter #panel-1729-3-0-0 .roll-button which is the selector for the CTA button in your about us page.

Regards,
Kharis

Perfect, It worked. Thank you so much

Dear Kharis,
Is there another way to make a call to action button (linked to a pdf for example), in any part of the page, open into a new tab without using triggers?
Many Thanks!

Hello there,

Thank you for asking.

You can enter any link of your choice including path to your PDF file. There is no way to make the button opens on a new tab other than this.

Regards,
Kharis

Hey Experts,
I have an Amazon affiliate site, http://buyincomfort.com & it has musical instruments as the products.
Now I think these are posts, as they call in WP & when someone clicks on the product, it displays details about it with image, price etc & the CTA button that redirects to Amazon.com site.
I would like to have the CTA button open in a new tab?
How do I do that?
Regards-Venu

Hello @kvenugopal,

What theme are you running?

Regards,
Kharis

Hey Kharis,
It’s just called a Review Theme & has interface with Amazon via API and I see a few other Review Theme settings to pull-in data from Aamzon.com.
If you tell m where the code needs to be changed relative to the CTA button, I can do it.
Warm Regards-Venu

Is it the theme you’re running?

Regards,
Kharis

Hey Kharis,
Thanks for your kind response. I am not running any aThemes theme.
I purchased this from someone who makes Amazon affiliate sites in different niches.
The “Appearance-Themes” menu doesn’t mention any theme name & after I uploaded the files for this site(after installing basic WP), I get a menu called “Review Theme” & it has settings for Amazon Associate & API keys & other category & product related settings. The CTA setting only shows values for color & text but I don’t see any option to insert code that enables opening a new tab upon clicking the CTA button.
If possible for you, we can have a Skype call & I can explain better. Alternatively, if you let me know your email address, I can send you the copy of the settings screen you might want to look at. I don’t see any option to send attachments to you in my response.
Warm Regards-Venu

Good evening,
I followed this instruction and it still does not open in a new tab. Thank you for the excellent work with the theme developed.

Thankful,

Link: http://achelauro.com.br/eventos/

For CTA widgets buttons, you can this code:

    jQuery(function($) {

     if( $('.promo-controls a').length ){

        $('.promo-controls a').attr('target', '_blank');

      }

    });

Regards,
Kharis

I did this, and it did not work.

Hugs,