Title: Dynamic header problems with php
Last modified: August 19, 2016

---

# Dynamic header problems with php

 *  [pavlos1982](https://wordpress.org/support/users/pavlos1982/)
 * (@pavlos1982)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/dynamic-header-problems-with-php/)
 * Hi i just want somebody to give me some help with a code im using on my website
   header which will create a unique picture for each page on the header im using
   this
 * PHP
 * <div id=”header” <?php if(is_page(‘About’)) : ?>class=”aboutpageclass”<?php else:?
   >class=”normalclass”<?php endif;?>>
 * Css
 * .aboutpageclass { background-image:someimage.jpg; }
    .normalclass { background-
   image:anotherimage.jpg }
 * This code works perfect for my about page but i want to do the rest of the pages
   on my site like contactus, home, gallery and i have tried dubplicating the code,
   it did nt work and just change the name is there anybody can help me figure this
   out?? or what to add to this code so i can get dynamic header for all my pages
   on my site , thank u in advance

Viewing 1 replies (of 1 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/dynamic-header-problems-with-php/#post-1285506)
 * Maybe you need some [elseif](http://php.net/manual/en/control-structures.elseif.php)
   conditions?

Viewing 1 replies (of 1 total)

The topic ‘Dynamic header problems with php’ is closed to new replies.

## Tags

 * [dynamic header](https://wordpress.org/support/topic-tag/dynamic-header/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 2 participants
 * Last reply from: [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/dynamic-header-problems-with-php/#post-1285506)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
