Snippets Not Working
-
I had some code where the old php tags worked just fine for a paypal button on my site. I put the code into a snippet and now it’s broke.
I’m just going to paste the relevant code to demonstrate the issue.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input name="amount" type="hidden" value=" [insert_php]if (isset($_GET['amount'])) {echo $_GET['amount'];} else {echo '397';}[/insert_php] " /> </form>The code is for dynamically upating the billing amount with ?amount=”xxxx” in the URL.
I put the code in a snippet and now have.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input name="amount" type="hidden" value=" [wbcr_php_snippet id="2008"] " /> </form>If I inspect the element, it just prints the short code as written in the html and sometimes strips off the end of the shortcode. I’m pretty sure it might have something to do with the quotes and/or using visual composer. I’ve tried using single quotes.
If I place the [wbcr_php_snippet id=”2008″] outside of the quotes it works properly.
Any advice?
The topic ‘Snippets Not Working’ is closed to new replies.