[resolved] Excerpt first line starts with two white spaces? (6 posts)

  1. wpmhweb
    Posted 4 years ago #

    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 http://biggmotivation.com, I have there some sample posts to see what I am referring to.


  2. p15
    Posted 4 years ago #

    Have you got any extra spaces in your code. Without seeing the code it would be hard to have a look!

  3. wpmhweb
    Posted 4 years ago #

    `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; ?>

  4. p15
    Posted 4 years ago #

    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?

  5. Michael
    Part-Time Forum Moderator
    Posted 4 years ago #

    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...

  6. wpmhweb
    Posted 4 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic