Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am having this issue when I am logged out of the back-office of Wordpress.

http://www.secure-events.co.za/about-us

For some reason the stops showing after the endwhile tag. Or it could be after the the_content() function. Here is the code:

<?php get_header(); ?>

  <div id="primary">
    <div id="content" class="content-singular" role="main">

      <div class="pad">

        <div class="hentry">

        <?php while ( have_posts() ) : the_post(); ?>

        <h1><?php the_title(); ?></h1>
        <?php the_content(); ?>

        <?php endwhile; ?>

        </div>

      </div>

    <div id="footer">
    </div>

    </div>

  </div>

<?php get_footer(); ?>

This only happens when I am logged out of the back-office. Strange right?

share|improve this question
Please refer to this diagram. – kaiser Oct 11 '12 at 17:36

closed as off topic by Chris_O, Stephen Harris, Michael, Brian Fegter, kaiser Oct 11 '12 at 17:36

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

It could also stop at have_posts() or the_post().

The first thing you should do is to enable the debug mode, in order to do so set the WP_DEBUG, WP_DEBUG_DISPLAY and WP_DEBUG_LOG constants to true. The last one causes an log file to be written to /wp-content/debug.log.

If neccessary restore the default error handler.

Then have a look if any errors pop up on your page. If not, insert some debug output between have_posts(), the_post() and the_content() to check where it actually stops, once you know that it might give you a clou.

As a last option, disable plugins one after another, and see if the behaviour changes at any point.

share|improve this answer
I have added a <?php echo "test"; ?> after the <?php the_content(); ?> line and it doesn't show when I am logged out. – Niel Roos Oct 11 '12 at 14:04
What about all the other things i've mentioned? – ndm Oct 11 '12 at 14:15
I have enabled WP_DEBUG but now debug.log was created in the wp-content folder. – Niel Roos Oct 11 '12 at 15:19
Oh and just another mention. This only occurs on the host the site is currently on. On my dev-host I didn't have this issue. – Niel Roos Oct 11 '12 at 15:20
Well, there's a good chance that it has something to do with Server/PHP/DB/Routing/etc configuration, however it's impossible to tell from here. So you'll need to do a little debugging (note: WP_DEBUG_LOG is needed in order for a log file to be created) and trial and error. – ndm Oct 11 '12 at 15:44
show 2 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.