Hi, i this this might be hard to solve. I want when viewing a single post, everything that appears before the <!--more--> tag to be bold (<strong>).
any ideas?
Hi, i this this might be hard to solve. I want when viewing a single post, everything that appears before the <!--more--> tag to be bold (<strong>).
any ideas?
So, why not just type the <strong> tags into the post?
because i have ~8000 posts and post ~10 new each day, what if i 2 months want italic instead, do you think i should edit them all?
well... on your theme's index page, style the post/content area(div) with bold. Use a different class in single.php.
sorry was unclear, it's in the single post i want this, to seperate the preamble from the body.
A bit of code (replace <?php the_content(); ?> in a theme's single.php template with the following):
<?php
$content = explode('<!--more-->', $post->post_content);
if( !empty($content[1]) ) :
?>
<div class="preamble">
<?php echo apply_filters('the_content', $content[0]); ?>
</div>
<?php echo apply_filters('the_content', $content[1]); ?>
<?php else : ?>
<?php the_content(); ?>
<?php endif; ?>
Then just style the teaser text through the .preamble css class.
This topic has been closed to new replies.