Title: Exclude div from header.php
Last modified: August 21, 2016

---

# Exclude div from header.php

 *  Resolved [kelleypb](https://wordpress.org/support/users/kelleypb/)
 * (@kelleypb)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/exclude-div-from-headerphp/)
 * I would like to remove the div containing my header image from one page. I tried
   wrapping the following code around the div in question:
 *     ```
       <?php if( !is_page('directions') ) : ?>
   
       <?php endif; ?>
       ```
   
 * But it still leaves the empty space. I need to add `display: none` so that the
   div disappears completely. I have searched everywhere but to no avail.

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

 *  Thread Starter [kelleypb](https://wordpress.org/support/users/kelleypb/)
 * (@kelleypb)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/exclude-div-from-headerphp/#post-4046327)
 * I also tried adding to the page `<style>
    .slogan { display: none !important;}
   </style>`
 * But the empty space contain the .slogan div remains. There must be some CSS rule
   overriding my code.
 *  Thread Starter [kelleypb](https://wordpress.org/support/users/kelleypb/)
 * (@kelleypb)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/exclude-div-from-headerphp/#post-4046328)
 * There was a height designated in pixels preventing the collapse. All solved.

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

The topic ‘Exclude div from header.php’ is closed to new replies.

## Tags

 * [display](https://wordpress.org/support/topic-tag/display/)
 * [div](https://wordpress.org/support/topic-tag/div/)
 * [header](https://wordpress.org/support/topic-tag/header/)
 * [No](https://wordpress.org/support/topic-tag/no/)
 * [page](https://wordpress.org/support/topic-tag/page/)
 * [single](https://wordpress.org/support/topic-tag/single/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [kelleypb](https://wordpress.org/support/users/kelleypb/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/exclude-div-from-headerphp/#post-4046328)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
