Title: insert conditional paypal button into sidebar
Last modified: August 20, 2016

---

# insert conditional paypal button into sidebar

 *  [souleye](https://wordpress.org/support/users/souleye/)
 * (@souleye)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/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](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/insert-conditional-paypal-button-into-sidebar/#post-2970917)
 * 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; ?>
       ```
   
 *  Thread Starter [souleye](https://wordpress.org/support/users/souleye/)
 * (@souleye)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/insert-conditional-paypal-button-into-sidebar/#post-2970967)
 * 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.

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [code](https://wordpress.org/support/topic-tag/code/)
 * [paypal](https://wordpress.org/support/topic-tag/paypal/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [souleye](https://wordpress.org/support/users/souleye/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/insert-conditional-paypal-button-into-sidebar/#post-2970967)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
