- This topic has 13 replies, 4 voices, and was last updated 2 years ago by David.
March 25, 2019 at 6:09 am #849030Andrew
Hi, I’ve used the Hook element to add some fixed position CTAs sitewide (Call and Email buttons). I’m trying to add a modal popup for the Email button but am running into an error when I try to include a form in the popup, specifically the input submit part.
Am I going about this the right way? Do I need to use a shortcode for the form html?GeneratePress 2.2.2GP Premium 1.7.8March 25, 2019 at 7:12 am #849214DavidStaffCustomer SupportMarch 25, 2019 at 7:41 am #849255Andrew
I’m adding the form as html into the content area of a hook element.
Appearance > Elements > New Hook
The code I add gets cut as soon as it reaches this line:
`<input style=”background-color:#cf6aa4;” class=”elementor-button” name=”submit” type=”submit” value=”Request a quote ” />
It also breaks the Edit Hook element page layout as well.
The form code I’m adding works fine in a custom html widget in the sidebar. e.g. https://www.healthy-weight.co.uk/gastric-band/
AndrewMarch 25, 2019 at 3:53 pm #849717DavidStaffCustomer SupportMarch 26, 2019 at 2:55 am #850063Andrew
Hi, yes, same code.March 26, 2019 at 3:11 am #850082DavidStaffCustomer SupportMarch 26, 2019 at 6:19 am #850209Andrew
Code removedMarch 26, 2019 at 6:31 am #850229Andrew
I thought the offending line was the submit input line but it appears to be the closing textarea, presumably because the area I’m entering the code into is also a textarea.
Publishing the following hook…
<textarea>This is a textarea</textarea>
…results in the following being saved
<textarea>This is a textarea
Any solution for including a text area in a hook? I’m assuming shortcodes but again, if there’s another way to produce the desired outcome I’m all ears.March 26, 2019 at 7:58 am #850473DavidStaffCustomer SupportMarch 26, 2019 at 10:22 am #850611TomLead DeveloperLead Developer
I tweaked this in 1.8.0-alpha.2, which we’re hoping to release tomorrow.
If you want to try the fix now, go to
wp-content/plugins/gp-premium/elements/class-metabox.phpand find this line:
<textarea id="generate-element-content" name="_generate_element_content"><?php echo get_post_meta( get_the_ID(), '_generate_element_content', true ); ?></textarea>
And replace it with this:
<textarea id="generate-element-content" name="_generate_element_content"><?php echo esc_textarea( get_post_meta( get_the_ID(), '_generate_element_content', true ) ); ?></textarea>
Let me know if that fixes it for you or not 🙂March 27, 2019 at 2:04 am #851082Andrew
That has indeed fixed it. Thanks very much 🙂
AndrewMarch 27, 2019 at 8:24 am #851561TomLead DeveloperLead DeveloperMay 22, 2019 at 2:40 am #907554Michael Loguidice
I am also trying to add a pop-up to my site… just wondering if this is done in Elements – header (type)?
the instructions from Mailchimp said: “Paste the code into your website’s HTML just before the closing < / head > tag.”
Thank you!May 22, 2019 at 4:26 am #907641
- You must be logged in to reply to this topic.