Displaying all single posts I think there are some confusing and weird indentation problems in this WordPress file (single.php). Any suggestions on improving indentation and readability?

&lt;?php
/**
 * The Template for displaying all single posts.
 *
 * @package WordPress
 * @subpackage Starkers
 * @since Starkers 3.0
 */

get_header(); ?&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;div id="content"&gt;
    &lt;?php // Set and display custom field
        $intro_image = get_post_meta($post-&gt;ID, 'Intro Image', true); ?&gt;
        &lt;div class="block-1"&gt;
            &lt;img src="&lt;?php echo $intro_image; ?&gt;" alt="" /&gt;
        &lt;/div&gt; &lt;?php
    ?&gt;

    &lt;?php // Start The Loop
        if ( have_posts() ) while ( have_posts() ) : the_post();
    ?&gt;  &lt;div class="block-2 padding-top no-overlay"&gt;
            &lt;?php the_content(); ?&gt;
        &lt;/div&gt;&lt;!-- .entry-content --&gt;
    &lt;?php endwhile; // end of the loop. ?&gt;

    &lt;?php //  Display previous and next posts thumbnails ?&gt;
        &lt;div class="block-2 border-top"&gt;
        &lt;?php // Set and display custom field
            $mainbar_left_title = get_post_meta($post-&gt;ID, 'Mainbar Left Title', true);
            $mainbar_left_image = get_post_meta($post-&gt;ID, 'Mainbar Left Image', true); ?&gt;
            &lt;div class="float-left"&gt;
                &lt;h2&gt;&lt;?php echo $mainbar_left_title; ?&gt;&lt;/h2&gt;
                &lt;img src="&lt;?php echo $mainbar_left_image ?&gt;" alt="" /&gt;
            &lt;/div&gt; &lt;?php
        ?&gt;

        &lt;?php // Set and display custom field
            $mainbar_right_title = get_post_meta($post-&gt;ID, 'Mainbar Right Title', true);
            $mainbar_right_image = get_post_meta($post-&gt;ID, 'Mainbar Right Image', true); ?&gt;
            &lt;div class="float-right"&gt;
                &lt;h2&gt;&lt;?php echo $mainbar_right_title; ?&gt;&lt;/h2&gt;
                &lt;img src="&lt;?php echo $mainbar_right_image ?&gt;" alt="" /&gt;
            &lt;/div&gt; &lt;?php
        ?&gt;
    &lt;/div&gt;

    &lt;?php // Set and display custom field
        $mainbar_right_title = get_post_meta($post-&gt;ID, 'Mainbar Right Title', true);
        $mainbar_right_image = get_post_meta($post-&gt;ID, 'Mainbar Right Image', true); ?&gt;
        &lt;div class="block-3 border-top"&gt;
            &lt;h2&gt;&lt;?php echo $mainbar_right_title; ?&gt;&lt;/h2&gt;
            &lt;img src="&lt;?php echo $mainbar_right_image ?&gt;" alt="" /&gt;
        &lt;/div&gt; &lt;?php
    ?&gt;

    &lt;?php // Start The Loop
        if ( have_posts() ) while ( have_posts() ) : the_post();
    ?&gt;  &lt;div class="block-4 border-top"&gt;
            &lt;?php the_content(); ?&gt;
        &lt;/div&gt;&lt;!-- .entry-content --&gt;
    &lt;?php endwhile; // end of the loop. ?&gt;

    &lt;?php get_sidebar('secondary'); ?&gt;
&lt;/div&gt;&lt;!-- #content --&gt;

&lt;?php get_footer(); ?&gt;
You could you PHP alternate syntax

&lt;?php
/**
 * The Template for displaying all single posts.
 *
 * @package WordPress
 * @subpackage Starkers
 * @since Starkers 3.0
 */
?&gt;

&lt;?php get_header(); 
&lt;?php get_sidebar(); ?&gt;

&lt;div id="content"&gt;
    &lt;?php $intro_image = get_post_meta($post-&gt;ID, 'Intro Image', true); ?&gt;
    &lt;div class="block-1"&gt;
        &lt;img src="&lt;?php echo $intro_image; ?&gt;" alt="" /&gt;
    &lt;/div&gt;

    &lt;?php if ( have_posts() ? while ( have_posts() ) : the_post()): ?&gt;  
        &lt;div class="block-2 padding-top no-overlay"&gt;
            &lt;?php the_content(); ?&gt;
        &lt;/div&gt;
    &lt;?php endwhile; ?&gt;

    &lt;div class="block-2 border-top"&gt;
        &lt;?php $mainbar_left_title = get_post_meta($post-&gt;ID, 'Mainbar Left Title', true); ?&gt;
        &lt;?php $mainbar_left_image = get_post_meta($post-&gt;ID, 'Mainbar Left Image', true); ?&gt;
        &lt;div class="float-left"&gt;
            &lt;h2&gt;&lt;?php echo $mainbar_left_title; ?&gt;&lt;/h2&gt;
            &lt;img src="&lt;?php echo $mainbar_left_image ?&gt;" alt="" /&gt;
        &lt;/div&gt;

            &lt;?php $mainbar_right_title = get_post_meta($post-&gt;ID, 'Mainbar Right Title', true); ?&gt;
            &lt;?php $mainbar_right_image = get_post_meta($post-&gt;ID, 'Mainbar Right Image', true); ?&gt;
        &lt;div class="float-right"&gt;
            &lt;h2&gt;&lt;?php echo $mainbar_right_title; ?&gt;&lt;/h2&gt;
            &lt;img src="&lt;?php echo $mainbar_right_image ?&gt;" alt="" /&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;?php $mainbar_right_title = get_post_meta($post-&gt;ID, 'Mainbar Right Title', true); ?&gt;
    &lt;?php $mainbar_right_image = get_post_meta($post-&gt;ID, 'Mainbar Right Image', true); ?&gt;
    &lt;div class="block-3 border-top"&gt;
        &lt;h2&gt;&lt;?php echo $mainbar_right_title; ?&gt;&lt;/h2&gt;
        &lt;img src="&lt;?php echo $mainbar_right_image ?&gt;" alt="" /&gt;
    &lt;/div&gt;

    &lt;?php if ( have_posts() ? while ( have_posts() ) : the_post()): ?&gt;
        &lt;div class="block-4 border-top"&gt;
            &lt;?php the_content(); ?&gt;
        &lt;/div&gt;
    &lt;?php endwhile; ?&gt;

    &lt;?php get_sidebar('secondary'); ?&gt;
&lt;/div&gt;

&lt;?php get_footer(); ?&gt;


This follows all WP coding standards from what I can tell and is readable.
I would also suggest changing sections like this:

&lt;?php $mainbar_right_title = get_post_meta($post-&gt;ID, 'Mainbar Right Title', true); ?&gt;
&lt;?php $mainbar_right_image = get_post_meta($post-&gt;ID, 'Mainbar Right Image', true); ?&gt;
&lt;div class="block-3 border-top"&gt;
    &lt;h2&gt;&lt;?php echo $mainbar_right_title; ?&gt;&lt;/h2&gt;
    &lt;img src="&lt;?php echo $mainbar_right_image ?&gt;" alt="" /&gt;
&lt;/div&gt;


To:

&lt;div class="block-3 border-top"&gt;
    &lt;h2&gt;&lt;?php echo get_post_meta($post-&gt;ID, 'Mainbar Right Title', true); ?&gt;&lt;/h2&gt;
    &lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, 'Mainbar Right Image', true) ?&gt;" alt="" /&gt;
&lt;/div&gt;


Although that's just personal preference, I find it much more readable.