Learn wordpress the_content() by examples

Description:

the_content( string $more_link_text = null, bool $strip_teaser = false )

Display the post content, but do not return the content. This function often be used in the loop

Examples:

1.Display the post content

<?php while ( have_posts() ) : the_post() ?>
<div id="post-<?php the_ID() ?>" class="<?php barthelme_post_class() ?>">
<div class="post-container">
<div class="post-content">
<h2 class="entry-title"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
</div>
</div>
</div><!-- .post -->
<?php endwhile ?>

Leave a Reply

Your email address will not be published. Required fields are marked *