APIs & Integrations

Metu
Member

shortcode rendering bug

 

hi,

 

my newsletter sign up form, renders into this when I'm using the shortcode:Capture.JPG

what can I do to solve it?

0 Upvotes
3 Replies 3
lscanlan
HubSpot Alumni
HubSpot Alumni

shortcode rendering bug

Hi @Metu,

 

Are you using the shortcode generated from the WordPress plugin? I'm not sure yet why that would happen, but could you link me to a page where you're seeing this in the source code? I wonder if maybe there's un-closed tag somewhere in the HTML? I'm not familiar with this, but I'm happy to troubleshoot it a bit more if I can see a page where this is happening.

 

Thanks,

Leland

Leland Scanlan

HubSpot Developer Support
0 Upvotes
Metu
Member

shortcode rendering bug

Hi,

Yes, I am using the shortcode generated from the wordpress plugin.

This is the page: https://www.metultalot.co.il/newsletter

Many thanks!

0 Upvotes
lscanlan
HubSpot Alumni
HubSpot Alumni

shortcode rendering bug

Hi @Metu,

 

Thanks for sending along your page. I'm not sure yet why it's happening, but I do see some errors in the form's code in your page's source code. Here's what the code currently looks like:

 

<p>
  <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script><br />
  <script>
    hbspt.forms.create({
      portalId: 6001370,
      formId: "177a7535-5de0-4745-b404-da67e6c31e8a",
      shortcode: "wp",</p>
      <p>
    });
  </script>
</p>

Here's what we need it to be:

 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
    portalId: 6001370,
    formId: "177a7535-5de0-4745-b404-da67e6c31e8a",
    shortcode: "wp",
  });
</script>

I just loaded your page locally (like just on my computer) with that^ code instead of the code that's currently on your live page, and it does load your form correctly. So it seems like this is simply a matter of removing some of those extra <p> and </p> tags from your page.

 

Do you have much control over the source code of your page? Is there a button somewhere to edit the source code where you can manually go in and remove those tags? Is it possible that you're inserting the shortcode in the middle of a paragraph tag? Like in between <p></p> ?

 

One other thing that might be helpful from a troubleshooting perspective would be to try using the shortcode in other areas of the same page, or on other pages altogether. And if it works in those places, that might help us narrow things down a bit.

 

Let me know if that makes sense, or if you're still having trouble. If you're not familiar at all with making edits like that, feel free to send me a direct message and maybe we can connect for a screenshare or something.

Leland Scanlan

HubSpot Developer Support
0 Upvotes