Support » Fixing WordPress » insert conditional paypal button into sidebar

  • I’m trying to insert a paypal button to show only on one page. I did it successfully with one theme, now, I’m using grey opaque theme, but it’s not working. I’m not sure what I’m doing wrong. the page id is 5, so here’s the code.

    <?php if ( !is_page(5) ) : else : ?>
    
    				<div class="paypal">
    				<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    -- paypal code goes here ---
    </form>
    
    				</div> <?php endif; ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try:

    <?php if ( is_page(5) ) :?>
    <div class="paypal">
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    -- paypal code goes here ---
    </form></div> <?php endif; ?>

    I think the paypal code is correct. it’s working perfect on another site. I believe the cause should be on what comes before:
    if(!dynamic_sidebar(‘primary-widget-area’)) : ?>
    I’ve never been able to understand what that means

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘insert conditional paypal button into sidebar’ is closed to new replies.