runPHP plugin used to add a PayPal button to a page or post
-
I’m developing a commerce site where my client wants a PayPal button placed in the page. When I place the PayPal button code in a page or a post it gets messed/deleted in the visual editor, and has errors when used in “code” with the visual editor turned off.
I’m installed runPHP to allow PHP code to be executed. I place the PayPal code in a document called ‘paypalbutton.php’ and place it in my theme folder. Then on the page/post where my client wants them placed, I put the following code in:
<?php include(‘paypalbutton.php’); ?>
And I get error messages about line numbers and such.
Here’s where I’m wondering if I’m a newbie-error-guy. Can I place the PayPal script inside the .php file just as I get it from PayPal, or do I need to add some php tags around it in the file?
To explain one other bit of info: I’ve removed the post “loop” from index.php to create a static page for a front page. That’s one location they want the button. The other is on a page template. These are all static pages, but I have a post page using a modified index.php to act like a static page but without sidebars.
Any ideas or tips about my .php file usage?
- The topic ‘runPHP plugin used to add a PayPal button to a page or post’ is closed to new replies.