0

我安装了 AW_Blog 扩展,但是我似乎在我的前端找不到任何东西(这是我正在处理的自定义构建主题)。我想接收所有帖子(或最后 x 个帖子)以手动将它们放入滑块中。

如何在我的 .phtml 布局文件中获取所有这些帖子?

谢谢。

4

1 回答 1

0

以下是获取 10 篇最新博文的方法:

<?php

$_sql = "SELECT * FROM `aw_blog` WHERE `status` = 1 ORDER BY `aw_blog`.`post_id` DESC LIMIT 0 , 10";

$_connection = Mage::getSingleton('core/resource')->getConnection('core_read');

foreach ($_connection->fetchAll($_sql) as $_post) {

$_post_date = date("m/d/y", strtotime($_post['created_time']));
$_post_content = strip_tags($_post['post_content']);
$_post_url_slug = $_post['identifier'];

}

?>
于 2013-06-03T12:48:18.600 回答