Viewing 15 replies - 1 through 15 (of 15 total)
  • Sounds like you are trying to get the button in a post ?
    If so – no can do.
    In the sidebar is fine, anywhere outside The Loop is fine but in the text edting box – no. The way WP works it’ll break that code everytime.

    Thread Starter rmgustaf

    (@rmgustaf)

    I see – I was trying to put it on a page post. Thanks very much!

    So what do you do instead? I want to add a Buy Now button via PayPal on a page. How do I insert this outside The Loop?

    You don’t. The simple way is: make a Page template for that Page and insert the code in the template file. Then make the Page using that template…

    Moshu, I found the docs regarding templates and think I understand how to create one. I’m not clear, though, how to “call” one up. In other words, how I do link to that template?

    Also, since this will no longer by a Page (if my assumption is correct), then to add to my navigation, I will need to know the code to use.

    Right now, I use:

    <?php wp_list_pages('depth=1&sort_column=ID&title_li='); ?>

    to add each page to my navigation. How do I call up a specific template?

    I hope you’re not totally annoyed with all of these inquiries. I’m just a simple gal in a sea of code jockeys… ??

    That’s fine, don’t worry. The forum is here to help (if we can).
    OK, by default to display a Page WP will use the “default Page template” of your theme – the file is called page.php.
    If there is no page template, then WP uses the index.php – see Template_Hierarchy.
    Now, if we want some special stuff in only ONE Page, but no others, then we create a special page template.
    You can just save your page.php file as my-page-with-button.php – and don’t forget to add the 3 lines at the top, as described in 7.3 on the Codex page I’ve linked.

    When all is done, you go Write > Write Page and create a new Page AND select the new template for the dropdown menu (=Page Templates). The new “thing” you create will be a Page.

    Finally. WP displays ALL the Pages you have created – if you use the template tag you posted above (less the children).

    Hope this helps and post back if you have more questions.

    Ohhhhhhhh! I think I get it. I will sit down later tonight (gotta put my 6 and 7 year olds to bed) and go for it.

    Regarding the button. I assume this has to sit “outside” the text on the Page entry?

    I’m not sure I know how I’ll do this, as I wanted to imtegrate text and an image along with a buy button.

    Maybe I should just hard-code it and have no actual text in the Page entry…

    What do you think?

    OK… I now have this working beautifully. I made a new page called buy.php, and essentially dropped the entire page layout code in the template. Then I created a page via the Admin panel whereby I entered on the title. (The rest of the content is contained in the template.)

    There’s just one problem…

    I wanted to password protect this page by adding a password in the Write Page Password-Protect-Post feature, but since the content sits outside of the “post”, it shows up when you select the page.

    Besides editing .htaccess, is there a way to protect the hard-coded content and prevent it from displaying until they enter the password?

    Moshu, feel free to move this post to a new topic. I wasn’t sure of the etiquette here.

    You won’t be able to put a button, but if you choose to not encrypt it, you get a link option.

    Then put an image with the link. That is what I have been doing on my blog.

    Could you point me to that page? I’d like to check it out.

    Got it. Thanks!

    Your welcome.

    This can be resolved without having to upload a page template or a plugin. To do this you need to turn off the WYSIWYG editor through your user panel.

    Then put in your paypal code.

    Finally, go through the paypal code and remove the line breaks paypal has put in there. For instance paypal has a line break between each input tag. Take these breaks out or else wordpress will manually place a < br> in there. That breaks paypal’s code.

    Be careful because there is probably a space in the last input tag (the “hidden” input tag) that needs to be there – there was in my code. It was in the “name” attribute in that code.

    What I did was paste my Paypal code into a text editor. Then I updated my Donate page in WordPress and did a View Source on my blog. I found the Paypal code and pasted it just beneath the original code in the text editor. I was able to figure out where WordPress inserted the extra < br> tags that way.

    This fixed the problem on my donate page. I didn’t really feel up to tackling anything bigger so I just tried to find another solution and it worked ??

    That is a good solution too skrimpy, but is too painful for new users.

    Adding the br that WP does can be a pain to post code, however like you suggested the solution exists ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Paypal Button Problems’ is closed to new replies.