Title: Adding a banner above posts
Last modified: August 21, 2016

---

# Adding a banner above posts

 *  [chrisntoukas](https://wordpress.org/support/users/chrisntoukas/)
 * (@chrisntoukas)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/adding-a-banner-above-posts/)
 * Hello there.
 * I was wondering if there is any way that i can add a banner above posts of a 
   specific category.
 * Thanks in advance.

Viewing 1 replies (of 1 total)

 *  [Maria Antonietta Perna](https://wordpress.org/support/users/antonietta456/)
 * (@antonietta456)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/adding-a-banner-above-posts/#post-4805661)
 * Hi chrisntoukas,
 * One way you can do this is by following these steps:
 * 1. Create a child theme;
    2. duplicate single.php from the parent to the child(
   create a file called single.php and copy all of the content from single.php in
   the parent theme into single.php in the child theme); 3. In single.php in the
   child theme, find the place where you want the banner ad to appear and add the
   following snippet
 *     ```
       <?php if (in_category ('category1')) {  ?>
       	<div class="banner-ad">
       	 This is a banner ad
       	</div>
   
       <?php } ?>
       ```
   
 * On the basis of the code above, if we’re viewing a post in category 1, a banner
   ad will be displayed.
 * Obviously, you will adapt the category slug (the category name) and the mark-
   up for the banner ad to your own needs.
 * I hope it helps.

Viewing 1 replies (of 1 total)

The topic ‘Adding a banner above posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Maria Antonietta Perna](https://wordpress.org/support/users/antonietta456/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/adding-a-banner-above-posts/#post-4805661)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
