Theme is being injected into my markup (3 posts)

  1. phlum
    Posted 3 years ago #

    This is a bizarre issue...
    I've set up WordPress in its own directory and followed the Codex documentation on giving WordPress its own directory. I've set it up normally otherwise.
    My blog page (called blog.php) has all the code required to make WP work. However, when I view the page, this happens:


    Excuse the text, it's mostly filler.

    I have set WP_USE_THEMES to false, I have require('./wordpress/wp-blog-header.php'); and get_header(); at the top of my page.
    The loop is as follows:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h2><?php the_title(); ?> <span class=\"author\">by <?php the_author(); ?> on <?php the_date(); ?></h2>
    <?php the_content ?>
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>";

    I have no idea what is going on here or how to remedy it. Hopefully someone here knows how to deal with this...?

    Note that I can't provide a link to the page as I'm currently running it using XAMPP on localhost.


  2. s_ha_dum
    Posted 3 years ago #

    Since you say that the "Theme is being injected into my markup", I assume the problem is that the theme header is showing up on top of your content? get_header() is going to pull in the theme's header. That is why you see the theme header.

  3. phlum
    Posted 3 years ago #

    I thought get_header was required in any case... Well, you learn something new every day. I'll have a tinker once I get back to my PC.

Topic Closed

This topic has been closed to new replies.

About this Topic