这是我的循环代码。
<?php $posts = get_posts ("orderby=date&numberposts=1"); ?>
<?php if ($posts) : ?>
<?php foreach ($posts as $post) : setup_postdata ($post); ?>
<a href="<?php the_permalink() ?>" d="center-news">
<div class="center-news-image">
<img src="<?php echo get_template_directory_uri(); ?>/images/example.jpg" />
</div>
<div class="center-news-text">
<div class="center-news-title"><b><?php the_title(); ?></b></div>
<div class="center-news-info">
<?php the_content(); ?>
</div>
</div>
</a>
<?php endforeach; ?>
<?php endif; ?>
如果帖子的内容很长,它将破坏 html。我需要显示一小部分内容。可能吗?