When we integrate fishpig with magento we can have one folder
“wordpress” in the template folder.(path:- app\design\frontend\base\default\wordpress).
in that we can create our custom folder like “xyz”.
in that we need to create one .phtml file called “xyz.phtml”.
the followings code returns the post name, post featured image etc…
<?php $posts = $this->getPosts() ; if (count($posts) > 0): foreach($posts as $post): ?> <img src=" <?php echo $image_url = $post->getFeaturedImage()->getAvailableImage();?>" /> // also call here getAvailableImage(); for Featured image plz take <img> tag <?php echo getPermalink(); // Post link echo $post_date = $post->getPostDate(); // Post date echo $post_day = date('l', strtotime($post_date)); // Day of Post echo $post_title = $post->getPostTitle(); // Post Title endforeach; endif; ?>
Then call this template in home page slide section like,
<?php createBlock('wordpress/sidebar_widget_posts')-> setTemplate('wordpress/xyz/xyz.phtml'); $blog->setPostCount(6); echo $blog->toHtml(); ?>
I do consider all the ideas you’ve presented on your post. They’re really convincing and can certainly work. Still, the posts are very brief for novices. May just you please extend them a little from next time? Thanks for the post. eaebacdbcgeb
LikeLike
Thank you very much for your feedback.. We will try to explain the posts in detail from now onwards. Though if you have any doubt feel free to write you comment below…
LikeLike
I have 1.8.0 magento version and 3.1.1.9 fishpig Version, but got this:
Fatal error: Call to undefined function createBlock() in /…/template/catalog/category/view.phtml on line 97
Can you help me, please!
LikeLike
Have you tried any bespoke customization in it?
LikeLike
Hii
I have Used this code but not working only image display in page other content not displayed and page Breaked..
LikeLike
code is not working
LikeLike
Hi, you’ve got an error in your code:
Instead of:
it should be
getLayout()->createBlock(‘wordpress/sidebar_widget_posts’)->
(Basically, you’ve missed off some of the code!)
LikeLike
It was bit dofficult with blog, but when i integrated wordpress blog to my magento store, now i add the featured image while posting any article, https://www.cloudways.com/blog/integrate-wordpress-blog-magento/ . This article helped me to configure this issue. Thanks for the share.
LikeLike