Reputation: 3066
I have integrate the fishbig in my magento site.(fishbig used for integrate wordpress with magento). now the posts are displayed fine.
now i need to get postname, postdate, post featured image and post link for displaying in the home page as slide. how can i get that?
Upvotes: 0
Views: 3987
Reputation: 3066
When we integrate fishbig with magento we can have one folder "wordpress" in the template folder.(path:- app\design\frontend\base\default\template).
in that we can create our custom folder like "home". in that we need to create one .phtml file called "slider.phtml".
the followings code returns the post name, post featured image etc...
<?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; ?>
Then call this template in home page slide section like,
<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>
Upvotes: 1