Return to Snippet

Revision: 26252
at April 21, 2010 17:20 by Kokkekniven


Updated Code
<?php /*
Example template
Author: mitcho (Michael Yoshitaka Erlewine) & Kokkekniven (Kristian Petersen)
*/ 
?><h3>Related posts</h3>
<?php if ($related_query->have_posts()):?>
<div>
	<?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
	<a href="<?php the_permalink() ?>" rel="bookmark" class="relatedimage" title="<?php the_title() ?>"><span><?php get_the_image( array( 'custom_key' => array( 'Thumbnail' ), 'default_size' => 'thumbnail' ) ); ?></span>
</a><!-- (<?php the_score(); ?>)-->
	<?php endwhile; ?>
</div>
<?php else: ?>
<p>No related posts.</p>
<?php endif; ?>

The style:
Im using a textwidget to display the code, instead of using the widget coming with the plugin:
#text-23{padding-left:15px;padding-right:15px;border:none;width:640px;display:block}
#text-23 .thumbnail{width:93px;height:93px}
#text-23 .H3{color:#000;font-size:20px;padding-top:10px}

Revision: 26251
at April 21, 2010 17:17 by Kokkekniven


Initial Code
<?php /*
Example template
Author: mitcho (Michael Yoshitaka Erlewine) & Kokkekniven (Kristian Petersen)
*/ 
?><h3>Related posts</h3>
<?php if ($related_query->have_posts()):?>
<div>
	<?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
	<a href="<?php the_permalink() ?>" rel="bookmark" class="relatedimage" title="<?php the_title() ?>"><span><?php get_the_image( array( 'custom_key' => array( 'Thumbnail' ), 'default_size' => 'thumbnail' ) ); ?></span>
</a><!-- (<?php the_score(); ?>)-->
	<?php endwhile; ?>
</div>
<?php else: ?>
<p>No related posts.</p>
<?php endif; ?>

Initial URL
http://www.kokkekniven.com

Initial Description
You can see the results under a single post, where photos are shown, without any text. The photo is taken from the uploaded photo from the post. All you need is the get the image plugin from www.justintadlock.com

Initial Title
Images with get the Image plugin for Yarpp

Initial Tags
wordpress

Initial Language
PHP