Child Theme preventing ConvertKit Form from loading on Mobil

Hi,
I’m using ConvertKit to capture email addresses on my website. I’ve been working with their engineering support on a problem I’m having getting the form to work when accessed by mobile. (It works when accessed via desktop).

They investigated and found:

  • “The problem is that theme you are using (X-Child) has a script defined that hijacks touch which is meant to show a modal.”

  • They can do a temporary fix, but “Keep in mind though that as soon as automatic update of the website will happen this will be overwritten and you will have to do it again.”

They suggested I contact X-Theme support and reference the following code:

“here is a bit of code that is causing troubles (so you may forward it to them for reference)”:

t(‘a[href*="#"]’).on(“touchend click”, function(i) {
if (href = t(this).attr(“href”),
notComments = href.indexOf("#comments") === -1,
“#” !== href && notComments) {
var n = href.split("#").pop()
, s = t("#" + n);
if (s.length > 0) {
if (i.preventDefault(),
a)
return;
e(s, 850, “easeInOutExpo”)
}
}
})

Over 50% of my traffic accesses the website via mobile, so this is really affecting capturing leads.

Thanks in advance for your assistance.
Marcy Travis
MarcyTravis.com

Hi there,

Thanks for writing in.

Please add this code to your global custom javascript.

jQuery ( document ).ready( function($) {

setTimeout ( function() {

$('a[href*="#"]').off('touchstart touchend');

} , 750 );

} );

That should remove the touch event that blocks event bubbling.

Thanks!

Thanks for your quick reply. Would you please instruct me where to find that file? Is it in the customization of the X-theme or a page I need to access within Wordpress (and if so, where do I access it)?
Again, thanks so much. :smile:

Hi there,

It’s not a file, and yes, you need to login in your Wordpress admin. Then you can go to Admin Bar > X > Theme Options > JS (click JS icon along with CSS icon in the vertical left toolbar), then add that code there.

And you can add the above code in there :slight_smile:

Thanks!

Thanks so much Rad, I’ll try that!

Let us know how it goes!

Yes, that worked. thank you. Now I’m having trouble editing cornerstone, and it is giving me an error message. Apparently, I have an X-shortcode that needs to be deleted but I don’t know where to go on my dashboard to delete it.

Hi there,

What error you’re getting? Would you mind providing your site’s URL and admin login credentials?

I like to check it, and make sure you have updated both of your X theme and cornerstone (I see users updated just their cornerstone and it caused issues). Or perhaps, don’t update them both if you’re not planning to jump to the latest X theme as of yet.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.