[英]Displaying a WordPress post in my Magento home page
我想在我的magento商店中顯示我的wordpress博客的最新博客文章,但在需要頭文件時遇到問題。
我正在嘗試:
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/blog/wp-blog-header.php');
$args = array('numberposts' => 5,
'orderby'=> 'post_date',
'post_type' => 'post',
'post_mime_type' => ,
'post_parent' => ,
'post_status' => 'publish',
'suppress_filters' => true );
$postslist = get_posts($args);
foreach($postslist as $post) : set_postdata($post); ?>
<div><p><?php the_date(); ?></p>
<p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></p>
</div>
<?php endforeach; ?>
Fishpig是Magento的一個很好的擴展,可以幫助您將Wordpress博客集成到您的Magento網站。 它的編碼非常好,可用於大量站點。 另外,它是免費的。 有功能可以幫助您獲取最新的博客文章: http : //fishpig.co.uk/wordpress-integration.html
@ mukund002您可以使用幾種解決方案。 首先,您可以使用Fishpig
模塊,該模塊可以工作,也可以您自己制作。 為此,您必須在Wordpress博客以及Magento中制作一些文件。 在http://www.magentowebshop.org/magento-webshop/magento-webshop-wordpress-integration-2/上有一本手冊。 它是荷蘭語,因此您可以使用Google翻譯。 我認為這是在fishpig
附帶其模塊之前fishpig
。
Fishpig在我們的案例中不起作用,但是我們以某種方式得到了解決方案。 我們從wordpress檢索數據,將其保存到數據庫中,然后通過Magento進行調用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.