Style the text before in single.php

I’d like to style differently the content before the link, but in single.php.

To be more specific, all my posts on the homepage only have a summary, and the rest of the text is cut thanks to the use of the more tag. So when I click on “read more” I see the complete post, starting with the summary we previously seen on the homepage. I’d like to differentiate this summary from the rest of the text, adding it some bold for example, to show to the user what he as already read.

Unfortunately I think this is not possible. Is it ?

2 Answers
2

using: http://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior

and the $strip_teaser parameter:
http://codex.wordpress.org/Function_Reference/the_content#Usage

in single.php, replace <?php the_content(); ?> with:

<?php if( strpos(get_the_content(), '<span id="more-') ) : ?>
  <div class="before-more">
  <?php global $more; $more=0; the_content(''); $more=1; ?>
  </div>
<?php endif; ?>     
<?php the_content('', true); ?>

Leave a Comment