Title: PHP Coding help
Last modified: August 19, 2016

---

# PHP Coding help

 *  Resolved [beisbolct](https://wordpress.org/support/users/beisbolct/)
 * (@beisbolct)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-coding-help-3/)
 * I need some help with a php code.
 * I have an advertiser who wants to run an ad on both the homepage and a single
   page. How do i go about doing this?
 * I currently have two ads that just run on homepage only. I need to make another
   ad appear on the home page and the 2009 red sox schedule page.
 *     ```
       <?php if ( is_home() )  { ?>
       <?php } ?>
       ```
   
 * is what I have for the homepage only ads. The page slug for the one to be added
   is 2009-boston-red-sox-schedule
 * If anyone can help me with this i’d really appreciate it. Every time I try, I
   keep messing it up.
 * My site is [http://soxanddawgs.com](http://soxanddawgs.com)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [shane-g](https://wordpress.org/support/users/shane-g/)
 * (@shane-g)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-coding-help-3/#post-1136594)
 * Hi,
 * In the sidebar [seidebar.php] or header [header.php] you can add the advertisement
   code..so you can view the advertisement on each pages..
 * while to add the advertisement on specific page you need to do hard code and 
   add it in the page from wordpress admin area page writing section..
 * Thanks,
 * Shane G.
 *  [xamataca](https://wordpress.org/support/users/xamataca/)
 * (@xamataca)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-coding-help-3/#post-1136598)
 *     ```
       <?php if ( is_home() || is_page(x) )  { ?>
       stuff here
       <?php } ?>
       ```
   
 * This shows the stuff either if is homepage or that page(x). Where X is the number
   of your page ID
    If you want to show that stuff in more pages:
 *     ```
       <?php if ( is_home() || is_page(array(x,y,z)) )  { ?>
       stuff here
       <?php } ?>
       ```
   
 * If you want it in a category too:
 *     ```
       <?php if ( is_home() || is_page/(array(x,y,z)) || is_category(x) )  { ?>
       stuff here
       <?php } ?>
       ```
   
 * More on the codex:
    [http://codex.wordpress.org/Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
 *  Thread Starter [beisbolct](https://wordpress.org/support/users/beisbolct/)
 * (@beisbolct)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-coding-help-3/#post-1136681)
 * Thanks Xamataca.
 * When I was looking at it, i couldn’t figure out the proper language at the top
   with the page. I’ll try it out in a bit.
 *  Thread Starter [beisbolct](https://wordpress.org/support/users/beisbolct/)
 * (@beisbolct)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-coding-help-3/#post-1136690)
 * Thanks again,
 * It worked perfectly. My problems stemmed from what to put after the home between
   them.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Coding help’ is closed to new replies.

## Tags

 * [conditional tags](https://wordpress.org/support/topic-tag/conditional-tags/)
 * [is_category](https://wordpress.org/support/topic-tag/is_category/)
 * [is_home](https://wordpress.org/support/topic-tag/is_home/)
 * [is_page](https://wordpress.org/support/topic-tag/is_page/)
 * [php code](https://wordpress.org/support/topic-tag/php-code/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [beisbolct](https://wordpress.org/support/users/beisbolct/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/php-coding-help-3/#post-1136690)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
