Title: Passing variables to header.php
Last modified: August 19, 2016

---

# Passing variables to header.php

 *  [simplethemes](https://wordpress.org/support/users/simplethemes/)
 * (@simplethemes)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/passing-variables-back-to-headerphp/)
 * Hi, I’m attempting to pass a variable from single.php to header.php.
 * For example in single.php I have:
    `<?php $wrapperstyle = "wide";?>`
 * I want to somehow pass this to the body_class as well.
 * `<body <?php body_class('$wrapperstyle'); ?>>`
 * Is this possible?

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

 *  Thread Starter [simplethemes](https://wordpress.org/support/users/simplethemes/)
 * (@simplethemes)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/passing-variables-back-to-headerphp/#post-1287791)
 * I believe I’ve found a solution to this but I’m curious if there is any performance
   issues for including header.php vs. using the get_header() function?
 *     ```
       <?php
       $wrapperstyle = "right";
       include(TEMPLATEPATH . '/header.php');
       ?>
       ```
   
 *  [retrocool](https://wordpress.org/support/users/retrocool/)
 * (@retrocool)
 * [16 years ago](https://wordpress.org/support/topic/passing-variables-back-to-headerphp/#post-1287986)
 * It might interfere with plug-ins which are called through the function get_header();
   (
   Example, CookieMonster, which I’m using) Don’t know about performance issues,
   should not be any IMO.

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

The topic ‘Passing variables to header.php’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [retrocool](https://wordpress.org/support/users/retrocool/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/passing-variables-back-to-headerphp/#post-1287986)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
