[Plugin: Yet Another Photoblog] Linking Thumbnails in Search Results to Post
-
I need to link the thumbnails in the search results to the post containing the image.
Here’s the code I used:
<?php get_header(); ?>
<div id=”content” class=”narrowcolumn”>
<?php if (have_posts()) : ?>
<h2 class=”pagetitle”>Search Results</h2>
<?php while (have_posts()) : the_post(); ?>
<div class=”searchthumbscontainer”>
<div class=”searchthumbs”>
<?php if ($post->image): ?>
image->uri ?>” class=”preview” title=”<?php the_title() ?>”>
<img src=”<?php echo $post->image->getThumbnailHref(array(‘w=500′,’fltr[]=usm|30|0.5|3’)) ?>” alt=”<?php the_title() ?>” title=”<?php the_title() ?>” width=”100″>
<?php endif ?></div>
</div>
<?php endwhile; ?><?php else : ?>
<h2 class=”center”>No posts found. Try a different search?</h2>
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?><?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Note: class=”preview” is for the rollover preview image function
I can’t get the preview function and the link to the post to work together.
- The topic ‘[Plugin: Yet Another Photoblog] Linking Thumbnails in Search Results to Post’ is closed to new replies.