Title says it all… I’ve got a new site that I’m working on:
(a search result page too)
http://motherapists.com/?s=jon
How do I get thumbnails floating left of the post excerpts? There’s one picture in each post. If I set a “featured image” it just floats atop, center… Looks like crap.
How do I get my search results and archive results to show thumbnails with the excerpts, images float=left?
Any help would be greatly appreciated! I’m stuck
Scott
Question in hand: How to get a thumbnail/picture with search results. Here’s the code in search.php
<div class="eleven columns">
<?php
if (have_posts()) :
while (have_posts()) : the_post();
get_template_part('loop', get_post_format());
endwhile; else :
get_template_part('loop', 'none');
endif;
?>
</div>
I don’t know why I’m posting this from function.php – as the excerpt code doesn’t even work… Unless It’s not being called in the above search.php?!
function typo_excerpt_length($length) {
if (has_post_format('status')) {
return 140;
} else {
return 60;
}
}
Love this forum… Thank you for all the help!
Scott
EXAMPLES
This is what the search result Excerpt looks like:
If I add a FEATURED IMAGE I get a post excerpt WITH a left floating thumbnail… But also for some reason a duplicate image centered not aligned… I want the thumbnail left of the Excerpt ONLY! And it’s gold!
Thanks!
Scott
Can you post your loop template? My guess is the indicator is there.
loop.php
<article <?php post_class('post') ?>>
<h2><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr(sprintf(__('Permanent Link to %s', 'typo-o-graphy'), the_title_attribute('echo=0'))); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</header>
<div class="post-content">
<?php
if ( has_post_thumbnail()) {
the_post_thumbnail('typo_single_post');
}
?>
<?php
if (!empty($post -> post_excerpt))
echo '<strong class="post_excerpt">'.get_the_excerpt().'</strong>';
?>
<?php the_content(__('Continue reading →', 'typo-o-graphy')); ?>
<?php wp_link_pages(array('before' => '<div class="page-link">' . __('<span>Pages:</span>', 'typo-o-graphy'), 'after' => '</div>')); ?>
</div>
<?php comments_template(); ?>
</article>
functions.php
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 620, 220, true );
add_image_size('typo_single_post', 620, 290, true);
set_post_thumbnail_size( 9999, 390, true );
add_image_size('typo', 2000, 390, true);
add_theme_support( 'post-formats', array( 'aside', 'gallery','image','link','video', 'quote','status','audio','chat' ) );
add_theme_support( 'automatic-feed-links' );
Nevermind I was able to figure this one out… The theme/framework that I’m working with basically needs to be gutted b/c its code is garbage. Took out a couple lines (and stopped calling junk code in the functions.php); made some additions to functions.php and called the new code and Voila!
You can’t fix broken… Just replace it… I’ll be back for some more help later without a doubt.
Thanks for taking a look @cpradio