get_header() not working outside wp directory
-
I can pull in the wordpress directory and can successfully use wp-loop to go through posts. However, the header will not pull in. If I use an include instead, the header will get pulled in, but will throw an error on semantic_body().
<?php define('WP_USE_THEMES', false); require('../../wp-blog-header.php'); get_header(); // I've tried this and it successfully pulled in the header // code but threw an error on semantic_body() // @include_once('/wp-content/themes/mytheme/header.php'); query_posts('category_name=help'); while (have_posts()) : the_post(); ?> <div id="post"> <h3><a><?php the_title();?></a></h3> <?php the_content( 'Read more' ); ?> </div> <?php endwhile; ?>The error I get when I use include instead of get_header() is:
Fatal error: Call to undefined function semantic_body() in
/wp-content/themes/enterprise_kaushal/header.php on line 108 Call Stack #TimeMemoryFunctionLocation 10.001976868{main}( )../private.php:0 21.103911145992include_once( ‘/wp-content/themes/enterprise_kaushal/header.php’ )../private.php:41
The topic ‘get_header() not working outside wp directory’ is closed to new replies.