- This topic has 5 replies, 2 voices, and was last updated 3 years, 11 months ago by
David.
-
AuthorPosts
-
April 10, 2019 at 8:50 am #865181
guyhanchet
The form code that PayPal gives me to access a hosted button has two hidden input fields. When I insert it in a page it results in extra <br> elements and lots of white space. I think it is Generate Press that inserts the <br> elements but it might be WordPress itself.
How can I suppress the extra space, especially compared to the Paypal Donation plugin result that looks good but does not allow me to use a button hosted at PayPal. The button behaves as expected so this is not a mission critical problem, but it bugs me.
What can I do to correct this? I do not want to get involved with the complexity of WooCommerce just to fix this cosmetic problem.
Here’s a test version of the page. https://forourgrandchildren.ca/test-page/
And here is the code I inserted (with the buttonid removed).
<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post” target=”_top”>
<input type=”hidden” name=”cmd” value=”_s-xclick” border=”0″/>
<input type=”hidden” name=”hosted_button_id” value=”xxxxxxxxxxx” />
<input type=”image” src=”https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif” border=”0″ name=”submit” title=”PayPal – The safer, easier way to pay online!” alt=”Donate with PayPal button” />
</form>GeneratePress 2.2.2GP Premium 1.7.8April 10, 2019 at 9:47 am #865257David
StaffCustomer SupportHi there,
GP won’t insert things like
<br>
tags it will be either WP or they are in the markup. To remove them is quite simple with this CSS:input + br { display: none; }
It removes any
<br>
tags that come after an input field.To make it specific i would edit your first line of the code to include a custom class like so:
<form action="https://www.paypal.com/cgi-bin/webscr" class="paypal-form" method="post" target="_top">
Then you can target that form specifically, in case other forms need the BR:
.paypal-form input + br { display: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 10, 2019 at 12:56 pm #865407guyhanchet
I checked with another theme and behaviour was still the same so it must be WP not GeneratePress. Your solution worked perfectly, although I wonder why you added class=”paypal” and also “class=”paypal-form”.
Thanks.April 10, 2019 at 2:23 pm #865446David
StaffCustomer SupportGlad to be of help. Sorry the first class was me copying and pasting the wrong markup. Delete that altogether.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 10, 2019 at 2:48 pm #865459guyhanchet
Cool everyone makes typos, and it wasn’t hard to see what you meant. Thanks for confirming.
April 10, 2019 at 2:51 pm #865460David
StaffCustomer SupportYou’re welcome 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.