-1

I have use Fishpig extension in my website.

But i need to show Next and Previous link with it's appropriate featured image.

Can anyone please provide appropriate suggestion for this requirement.

Thanks,

Chetan
  • 133
  • 1
  • 5
  • 17
  • 1
    I'm voting to close this question as off-topic because Stack Overflow is a [programming-related](http://stackoverflow.com/help/on-topic) Q&A site. Your question is not about programming. Perhaps you should post it on http://magento.stackexchange.com instead? – Enigmativity Feb 13 '17 at 03:59
  • Yes, i know that but i just need to help for any hint to customization. If you know anything then let me know. otherwise its Ok. – Chetan Feb 13 '17 at 07:12
  • I gave you a hint - and that's to post on a forum where this might be on topic. – Enigmativity Feb 13 '17 at 08:09

2 Answers2

1

The following code loads a post with the ID of 5 and if a featured image is set, it displays the image and a link to the post.

<?php $post = Mage::getModel('wordpress/post')->load(5) ?>
<?php if ($post->getId()): ?>
    <?php if ($image = $post->getFeaturedImage()): ?>
        <a href="<?php echo $post->getPermalink() ?>">
            <img src="<?php echo $image->getAvailableImage() ?>" alt="<?php echo $this->escapeHtml($post->getPostTitle()) ?>"/>
        </a>
    <?php endif; ?>
<?php endif; ?>

You can find more information on how to get different sized images from the featured image object at the URL below:

https://fishpig.co.uk/magento/wordpress-integration/post-images/

Ben Tideswell
  • 1,697
  • 2
  • 11
  • 14
0

The following article explains how to get an image object from a post object.

https://fishpig.co.uk/magento/wordpress-integration/post-images/

Specifically:

<?php // $post is already defined ?>
<?php if ($featuredImage = $post->getFeaturedImage()): ?>
    <a href="<?php echo $post->getPermalink() ?>">
        <img src="<?php echo $featuredImage->getAvailableImage() ?>" alt="<?php echo $this->escapeHtml($post->getPostTitle()) ?>"/>
    </a>
<?php endif; ?>
Ben Tideswell
  • 1,697
  • 2
  • 11
  • 14
  • Yes, But it's display current post image only. As per my requirement. I need specific post id image. For Example : If i specified post id 5 then show post id fifth featured image. – Chetan Feb 13 '17 at 11:19
  • Have you used Magento before? $post = Mage::getModel('wordpress/post')->load(5); – Ben Tideswell Feb 13 '17 at 14:33
  • Thanks, I have check this $post = Mage::getModel('wordpress/post')->load(5); But i did not get post featured image url in array response. Please check if i am wrong then let me know. – Chetan Feb 14 '17 at 11:18