• 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(); ?>
Viewing 6 replies - 1 through 6 (of 6 total)
  • Why is IE in compatibility mode? Do you have code above the DOCTYPE? Have you validated the pages to identify the problem?

    https://codex.www.ads-software.com/Validating_a_Website

    Thread Starter jules10622

    (@jules10622)

    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.

    Can you post a link to your site?

    Thread Starter jules10622

    (@jules10622)

    No, it is an intranet site.

    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 ??)

    Thread Starter jules10622

    (@jules10622)

    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?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Loop not displaying on single.php in IE Compatibility Mode’ is closed to new replies.