Roots Discourse

Get header outside of theme


#1

Hi,

I’m trying to get the theme’s header in a php file outside of the theme directory. Initially I found this solution - https://wordpress.stackexchange.com/questions/39630/insert-the-current-theme-header-into-an-external-html-xhtml-file

I adjusted it like so -

<?php
define('WP_USE_THEMES', true);
require('../../wp-blog-header.php');
?> 

The issue with this is it grabs not only the header but the body and footer. Using the code in the solution I linked grabs a header but not the theme’s header. Is there a better way of doing this with Sage in mind? It seems the way the theme compiles it’s hard to grab individual components outside of the blade views.

Thanks