Title: [Plugin: Dynamic Headers] to template pages
Last modified: August 20, 2016

---

# [Plugin: Dynamic Headers] to template pages

 *  [sdaponte](https://wordpress.org/support/users/sdaponte/)
 * (@sdaponte)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-dynamic-headers-to-template-pages/)
 * I’ve used the Dynamic Headers plugin to change the header of each page. However
   I haven’t been able to get it to work on individual templates.
 * I have two custom post types, each using their own template file. I’ve tried 
   passing a variable in both the templates to the header file, but it didn’t work.
   I also tried using an if statement in the header.php file to grab the body class
   and pass a string to $dynamic_header_url, but it then applies to every page on
   the site.
 * <div id=”container”>
    <?php if(function_exists(‘dh_get_page_image_url’)){ $dynamic_header_url
   = dh_get_page_image_url(); if ($body_class=’single-writing’){$dynamic_header_url
   = ‘header-page-6.jpg’;} }
 * Do you see what I could be doing wrong?
    Thaannk you!!

The topic ‘[Plugin: Dynamic Headers] to template pages’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [headers](https://wordpress.org/support/topic-tag/headers/)
 * [page](https://wordpress.org/support/topic-tag/page/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [single](https://wordpress.org/support/topic-tag/single/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 0 replies
 * 1 participant
 * Last reply from: [sdaponte](https://wordpress.org/support/users/sdaponte/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-dynamic-headers-to-template-pages/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
