利用fishpig_wordpress_integration插件整合WordPress到Magento


magento目录下新建子目录blog,上传wordpress文件到该目录.

新建数据库magento_blog,也可以省略这一步,直接装在原数据库上,用前缀区分表.

运行http://yourmagento.com/blog安装wordpress.

安装fishpig_wordpress_integration插件,地址为http://www.magentocommerce.com/magento-

connect/fishpig/extension/3958/fishpig_wordpress_integration

后台进入/WordPress/Setting/Database Integration配置相关信息

Database
设置wordpress数据库位置,是与magento同一数据库还是单独数据库.
Integration
设置整合方式
Semi-Integration
Semi-Integration在magento应用程序中提供有限量的wordpress信息,且不自动显示.适合只想在magento中显示少量wordpress信息,让maegnto

跟wordpress保持各自的模板主题.
Full-Integration
Full-Integration允许wordpress的所以前台显示由magento负责,换言之wordpress使用magento的模板主题包.适合不想为wordpress单独制作模

板的用户.
如果选择Full-Integration,需要设置Blog Route,假设设置为wp,需要进入wordpress后台Settings->General设置Site address为
http://yourmagento1/index.php/wp

显示最新文章
<reference name="left">
    <block type="wordpress/post_list_recent" name="wp.recent-posts" template="wordpress/post/recent.phtml">
        <action method="setTitle"><title>Recent Posts</title></action>
        <action method="setPostCount"><post_count>3</post_count></action>
    </block>
</reference>
{{block type="wordpress/post_list_recent" template="wordpress/post/recent.phtml" title="Recent Posts" post_count="3"}}

显示指定目录
<reference name="left">
  <block type="wordpress/post_list_recent" name="wp.recent-posts" template="wordpress/post/recent.phtml">
    <action method="setTitle"><title>Recent Posts</title></action>
    <action method="setPostCount"><post_count>3</post_count></action>
    <action method="setCategoryId"><category_id>1</category_id></action>
  </block>
</reference>
{{block type="wordpress/post_list_recent" template="wordpress/post/recent.phtml" title="Recent Posts" post_count="3"
category_id="1"}}

显示指定作者
<reference name="left">
  <block type="wordpress/post_list_recent" name="wp.recent-posts" template="wordpress/post/recent.phtml">
    <action method="setTitle"><title>Recent Posts</title></action>
    <action method="setPostCount"><post_count>3</post_count></action>
    <action method="setAuthorId"><author_id>1</author_id></action>
  </block>
</reference>
{{block type="wordpress/post_list_recent" template="wordpress/post/recent.phtml" title="Recent Posts" post_count="3"
author_id="1"}}

转载于:https://www.cnblogs.com/hidepeng/archive/2011/07/06/2099355.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值