Magento - Fishpig Wordpress - Featured image sizes -
i have installation of magento integrates wordpress using fishpig wordpress module.
as wp users know, when uploading image wordpress create resized versions referencing dimensions set in media settings (e.g. thumbnail size, medium size , large size). creates images each custom thumbnail size specify (e.g. via functions.php).
it appears though fishpig magento module uses thumbnail image size.
unfortunately need able display different sizes of same image (i.e. resized versions wordpress creates) on different pages. example, category page display small version, post view page display larger version.
i wondering if has had experience retrieving other resized images via module can't find documentation on (or if it's possible module couldn't see code suggest functionality).
greatly appreciate help.
i had same issue...i wanted create recent posts widget , fishpig has documented, didn't show example of how pull featured image post.
but found answer in: /app/design/frontend/base/default/template/wordpress/post/list/renderer/default.phtml
:
<?php if ($featuredimage = $post->getfeaturedimage()): ?> <div class="featured-image left"> <a href="<?php echo $post->getpermalink() ?>" title="<?php echo $this->escapehtml($post->getposttitle()) ?>"><img src="<?php echo $featuredimage->getavailableimage() ?>" alt="<?php echo $this->escapehtml($post->getposttitle()) ?>"/></a> </div> <?php endif; ?>
you can change "getavailableimage" of these pull different images sizes wordpress produces:
getthumbnailimage() getmediumimage() getlargeimage() getfullsizeimage() getpostthumbnailimage() getavailableimage() getimagebytype($type = 'thumbnail')
hope helps!
Nice article. It's very helpful to me. Thank you for share with us. Can you please check my article Display child pages featured image, page title & content on parent page WordPress
ReplyDelete