我已经设法从 wordpress 将三篇最新的博客文章放到我的外部网站上,但只能让它们放在一个 div 中。我的问题是如何让他们每个人都坐在自己的 div 中。我需要他们这样做,以便我可以单独设置每个样式(它们每个都位于不同颜色的盒子中,并使用 Gridset 定位)。
到目前为止,这是我的代码:
<?php
// Include Wordpress
define('WP_USE_THEMES', false);
require('wordpress/wp-load.php');
query_posts('posts_per_page=3');
?>
<div id="blogFeed">
<?php while (have_posts()): the_post(); ?>
<p class="subHeader"><?php the_date(); ?></p>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<p class="moreNews darkGrey"><a href="<?php the_permalink(); ?>" target="_blank">Read more...</a></p>
<?php endwhile; ?>
</div>
我已经坚持了很长时间,所以任何帮助都将不胜感激。