如何在静态html网站上显示Wordpress中的一个(精选)帖子?

时间:2013-01-25 02:24:29

标签: php html wordpress

我们的网站(http://www.litepanels.com/news/)上有一个Wordpress新闻博客,与静态html网站的其他部分分开。我只是想把最新的故事(精选帖子)显示在我们的主页上。博客和我们的网站在同一台服务器上。我发现我可以抓住这样的帖子:

<?php
require('../news/wp-blog-header.php');
 ?>
<?php query_posts('showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php       the_title(); ?>"><?php the_title(); ?></a><br />
<?php endwhile;?>

但是我不太熟悉PHP,我如何抓住精选帖子(其中包含标题,图片和文字,如上面的链接所示)

我在这里测试:http://www.litepanels.com/newwebsite/blog_test2.php

1 个答案:

答案 0 :(得分:0)

如果这对您有用,则意味着除了某种显示信息的方式外,您已经拥有了所需的一切。为此,Wordpress提供了一些可在while循环中使用的模板标记。 the_content是您需要的。 Others can be found in the Codex.

相关问题