SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Website Search Results, Archives - Need Thumbnails by Excerpts.. HELP!

    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

  2. #2
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Question in hand: How to get a thumbnail/picture with search results. Here's the code in search.php
    Code:
    <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?!
    Code:
    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

  3. #3
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EXAMPLES

    This is what the search result Excerpt looks like:
    1.jpg


    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!
    2.jpg

    Thanks!

    Scott

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,233
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    Can you post your loop template? My guess is the indicator is there.

  5. #5
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    loop.php
    Code:
    <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 &rarr;', '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
    Code:
    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' );

  6. #6
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •