0
我已經在我的magento網站中集成了fishbig(fishbig用於集成wordpress和magento)。現在帖子顯示正常。如何在magento主頁上顯示精選圖片的博客文章?
現在我需要獲取postname,postdate,發佈精選圖片和帖子鏈接,以在幻燈片主頁中顯示。我怎麼弄到的?
我已經在我的magento網站中集成了fishbig(fishbig用於集成wordpress和magento)。現在帖子顯示正常。如何在magento主頁上顯示精選圖片的博客文章?
現在我需要獲取postname,postdate,發佈精選圖片和帖子鏈接,以在幻燈片主頁中顯示。我怎麼弄到的?
當我們將fishbig與magento集成時,我們可以在模板文件夾中有一個文件夾「wordpress」。 (path:- app\design\frontend\base\default\template).
因爲我們可以創建我們的自定義文件夾,如「家」。因爲我們需要創建一個名爲「slider.phtml」的.phtml文件。
的以下代碼返回崗位名稱,崗位特色圖像等..
<?php $posts = $this->getPosts()
if (count($posts) > 0): ?>
<?php
foreach($posts as $post): ?>
<?php
$image_url = $post->getFeaturedImage()->getFullSizeImage(); // Featured image
$post_link = $post->getPermalink(); // Post link
$post_date = $post->getPostDate(); // Post date
$post_day = date('l', strtotime($post_date)); // Day of Post
$post_title = $post->getPostTitle(); // Post Title
<?php endforeach; ?>
<?php endif; ?>
然後調用在主頁滑動部分這樣的模板,
<div class="home_banner">
<?php
$magento_block = Mage::getSingleton('core/layout');
$blog = $magento_block->createBlock('wordpress/sidebar_widget_posts')->setTemplate('wordpress/home/homeslide.phtml');
$blog->setPostCount(6);
echo $blog->toHtml();
?>
</div>