Magento Fishpig Wordpress模块-创建自定义帖子列表

Magento Fishpig Wordpress模块-创建自定义帖子列表,wordpress,magento,fishpig,Wordpress,Magento,Fishpig,这应该很简单,但由于某些原因,它不是。我只是希望能够加载到自己的模板文件中,并能够访问$this->getPosts方法 我试过: <block type="wordpress/post_list" name="blog_header" template="unleaded/fishpig/header.phtml"/> 然后在我的模板中: <?php $_posts = $this->getPosts() ?> <?php foreach ($_posts

这应该很简单,但由于某些原因,它不是。我只是希望能够加载到自己的模板文件中,并能够访问$this->getPosts方法

我试过:

<block type="wordpress/post_list" name="blog_header" template="unleaded/fishpig/header.phtml"/>
然后在我的模板中:

<?php $_posts = $this->getPosts() ?>
<?php foreach ($_posts as $_post) : ?>
     <?php echo $_post->getAuthor() ?>
<?php endforeach ?>
这是行不通的。查看main List.php块文件,集合是基于包装器返回的,但我似乎找不到它是什么


其他人是否有在Magento的任何模板中获取帖子列表的代码示例?

只需先抓取块即可。还有其他方法,但这对我来说很有效

<?php $_block = $this->getPostListBlock() ?>
<?php $_posts = $_block->getPosts() ?>