我在帖子中有我的新闻,我正试图在主页上显示两篇最新的新闻文章(帖子)。我通过使用the_title()
并使用the_excerpt()
.
我想展示更多将您带到帖子的链接。然而,我正在发布的一些新闻文章在帖子正文中有一些文本,这是一个链接,我如何只在帖子正文中获得链接,以便我的更多链接直接将您带到那里?
例如,有时我们会链接到另一台服务器上PDF中的新闻文章。
我正在使用以下代码。
<?php query_posts(\'category_name=news2011\'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php /* the_ID(); */ ?>
<?php /* the_date(\'F Y\'); */ ?>
<ol class="news">
<strong><p><?php the_title()?></p></strong>
<li><?php the_content(); ?></li>
</ol>
<?php endwhile; endif; ?>