Support » Fixing WordPress » Excerpt first line starts with two white spaces?

  • Resolved wpmhweb


    I am building a new website and in the homepage I am using the excerpt, but some how the first line starts with two white lines. There is anyway to fix this and all the text to align?
    The website is, I have there some sample posts to see what I am referring to.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Have you got any extra spaces in your code. Without seeing the code it would be hard to have a look!

    `This is how the loop.php looks like for the excerpt:

    <?php if ( is_search() ) : // Only display excerpts for archives and search. ?>
    <div class=”entry-summary”>
    <?php the_excerpt(); ?>
    </div><!– .entry-summary –>
    <?php else : ?>
    <div class=”entry-content”>
    <?php /* Post with thumbnail*/ ?>
    <a>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_post_thumbnail( ‘home-thumbnail’, array(“class” => “alignleft post_thumbnail”), true); ?></a>

    <?php the_excerpt(); ?>
    <div class=”entry-meta-homepage entry-meta”><?php the_time(‘M jS, Y’) ?> <!– by <?php the_author(); ?> under <?php the_category(‘ / ‘) ?>–><?php edit_post_link(‘Edit’, ‘ <span class=”text-separator”>|</span> ‘, ”); ?>

    </div><!– .entry-meta –>

    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘twentyten’ ), ‘after’ => ‘</div>’ ) ); ?>

    </div><!– .entry-content –>

    <?php endif; ?>

    It seems to me to be printing an extra &nbsp; at the beginning of the excerpt. Are you hand crafting the excerpts in the post page and perhaps adding a space in there? Otherwise Im sorry im not sure how else to help on this one. perhaps someone else might have a better idea?



    Forum Moderator

    your text in the post content seems to atasrt with an ’empty’ paragraph containing just the non-braking-space character:

    from the html code of a single post:

    <p>Not so with Brainsc.....

    the excerpt function generates what you get at the start of your excerpt:
    <p>&nbsp; Not so with Brainsc.....

    imho, there is nothing you can easily do to get rid of it, apart from editing each post…

    I got it! The problem was a break between the first image in the post and the body content of the post. I just delete the one line of space between the two and now is working fine.

    Thank you guys for checking on this!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Excerpt first line starts with two white spaces?’ is closed to new replies.