Skip to content

Instantly share code, notes, and snippets.

@jeremyfelt
Created November 26, 2013 22:55
Show Gist options
  • Select an option

  • Save jeremyfelt/7667802 to your computer and use it in GitHub Desktop.

Select an option

Save jeremyfelt/7667802 to your computer and use it in GitHub Desktop.
<?php
$new_global_ver = 'test';
include( locate_template( 'header.php' ) ); // $new_global_var available to header.php
////////// OR ///////////
get_header( 'test' ); // If one variation is needed, use a different template
////////// OR ////////////
global $wp_query;
$wp_query->query_vars['_sneak_test'] = 'test';
get_header(); // $wp_query global and our _sneak_test are available to header.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment