Skip to content

Instantly share code, notes, and snippets.

@LinzardMac
Last active December 17, 2015 17:09
Show Gist options
  • Save LinzardMac/5644471 to your computer and use it in GitHub Desktop.
Save LinzardMac/5644471 to your computer and use it in GitHub Desktop.
// Include WP
define('WP_USE_THEMES', false);
in
// actually contains what you would expect
var_dump($wp_query);
//set it as a global (get same error with or without this set)
global $wp_query;
class WordpressHeader extends Module
{
public function hookDisplayHeader(){
return '<link rel="stylesheet" type="text/css" media="all" href="'. get_stylesheet_uri() . '">';
do_action( 'init' );
}
public function hookDisplayFooter(){
$wp_query = new WP_Query( 'post_type=any', 'nopaging=true' );
// same error with or without this global set
global $wp_query
//here it returns NULL
return dynamic_sidebar( 'footer' );
}
# return dynamic_sidebar( 'footer' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment