WordPress.org

Ready to get started?Download WordPress

Forums

Loop not displaying on single.php in IE Compatibility Mode (7 posts)

  1. jules10622
    Member
    Posted 1 year ago #

    Some IE8 and IE9 users are being forced into compatibility mode when viewing my WordPress site. The only problem this seems to cause is that when they click to view a full post on single.php, none of the content shows up. The header, footer, and sidebar show up, but no post title, content, or comments template. Nothing in the entire loop. When they switch out of compatibility mode, the loop does not appear.

    This problem only occurs with some IE8 and IE9 users. Others can see the posts just fine.

    Is there something I can change in the code that will stop IE from forcing compatibility mode? Or that will still show the loop in compatibility mode?

    Here is the code for my single.php:

    <?php get_header(); ?>
    
    	<div id="content">
    
        <?php while ( have_posts() ) : the_post(); ?>
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        	<header>
                <h1 class="entry-title"><?php the_title(); ?></h1>
                <div class="entry-meta">Posted on <time datetime="<?php the_time( 'Y-m-d' ); ?>"><?php the_time( 'F j, Y' ); ?></time></div>
        	</header>
    
    			<div class="entry-content"><?php the_content(); ?></div>
    
    		<footer>
    			<div class="entry-meta">Categorized in <?php the_category(', '); ?><br />
                <?php the_tags(); ?>
                </div>
        	</footer>
            <div class="post-spacer"></div>
            <?php comments_template( '', true); ?>
        </article>
    
    				<?php endwhile; // end of the loop. ?>
    
        </div>
    
    <div id="secondary" class="widget-area" role="complementary">
    	<?php get_sidebar(); ?>
    </div>
    
    <?php get_footer(); ?>
  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Why is IE in compatibility mode? Do you have code above the DOCTYPE? Have you validated the pages to identify the problem?

    http://codex.wordpress.org/Validating_a_Website

  3. jules10622
    Member
    Posted 1 year ago #

    I don't have any code above the doctype. I am using <!DOCTYPE HTML>.

    I validated the page with the W3C Markup Validator and it was fine.

    I should point out that the post content shows up in the source code. It just does not display.

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Can you post a link to your site?

  5. jules10622
    Member
    Posted 1 year ago #

    No, it is an intranet site.

  6. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the post content shows up in the source code. It just does not display.

    might be a problem with html commenting in the code (possibly in header.php in the conditional IE section ??)

  7. jules10622
    Member
    Posted 1 year ago #

    This is in my head section:

    <!--[if lt IE 9]>
       <script>
             document.createElement('header');
             document.createElement('nav');
             document.createElement('section');
             document.createElement('article');
             document.createElement('aside');
             document.createElement('footer');
       </script>
    <![endif]-->

    Could this be problem?

Topic Closed

This topic has been closed to new replies.

About this Topic