我正在使用 Ben 的 fishpig 代码,它将相关的帖子摘录放在首页:http: //fishpig.co.uk/magento/wordpress-integration/services/recent-posts-block/#code
但是,我已经设法将此代码用于首页和自定义选项卡 CMS 块中,但我无法弄清楚如何让特色图像与摘录一起显示。
前页 XML
**
* Display a list of your 5 most recent WordPress Posts
* Also include post excerpt, date and comment count
*
* {{block type="wordpress/sidebar_widget_posts" name="wordpress.widget.recent_posts" post_count="5" title="Latest Posts" excerpt="on" excerpt_length="1" date="on" comment_num="on" template="wordpress/sidebar/widget/categoryposts.phtml"}}
*/
-->
<reference name="head">
<action method="addItem"><type>skin_css</type><name>css/custom.css</name></action>
</reference>
<reference name="content">
<block type="wordpress/sidebar_widget_posts" name="wordpress.widget.recent_posts" as="recent_posts" template="wordpress/sidebar/widget/categoryposts.phtml">
<action method="setTitle"><title>Latest Posts</title></action>
<action method="setPostCount"><post_count>5</post_count></action>
<action method="setExcerpt"><display>on</display></action>
**HELP**--><action method="setFeaturedImage"><display>on</display></action>
<action method="setDate"><date>on</date></action>
<action method="setCommentNum"><comments>on</comments></action>
</block>
</reference>
这是自定义选项卡的代码:
{{block type="wordpress/sidebar_widget_posts" name="wordpress.widget.recent_posts" post_count="5" category_id="19" title="Latest Posts" excerpt="on" excerpt_length="1" date="on" comment_num="on" template="wordpress/sidebar/widget/categoryposts.phtml"}}
谢谢!