上传wordpress安装包到你的magento根根目录,用网址:http://yourdomain/magento/wordpress来 安装,这里的安装路径按你的实际情况来定,如果你的magento直接安装在网站根目录,那么就用http://yourdomain /wordpress来安装,注意安装的时候你可以装在magento的数据库中,最好把你的wordpress的表加个前缀防止和magento的表有 冲突,当然你也可以把wordpress安装在独立的数据库。 安装好后接下来我们就要想办法把wordpress的文章调用到magento页面中,最简便的办法就是把wordpress的RSS输出的内容输入到magento z中。 新建一个文件,放在magento的template的模块中,例如我们新建app/design/frontend/default/default/template/callouts/magento_blog.phtml文件,然后加入代码: <?php $channel = new Zend_Feed_Rss('http://yourdomin/blog/?feed=rss2'); ?> 现在我们就要在magento布局中调用这个magento_blog.phtml文件, 1.如果想在产品页右栏调用: 打开catalog.xml文件 找到<catalog_product_view>,然后在<refrence name="right"></refrence>中加入代码, <block type="core/template" template="callouts/magento_blog.phtml"/> 2.在CMS页面中调用: {{block type="core/template" template="callouts/magento_blog.phtml"/}} 接下来讲介绍另外一种集成wordpress的方法(待续) |