• Can I add a thumbnail to a post so that the thumnbail will show in an excerpt but not be shown within the post itself?

    I cant figure out how to do this without actually embedding the image in the post which I dont want to do.

    Can anyone tell me how to do this?

Viewing 14 replies - 1 through 14 (of 14 total)
  • If you already know how thumbnails work, just use “the_post_thumbnail” on the index.php/home.php and on single.php don’t use it?

    If you don’t know how the thumbnails work yet, read this.
    http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/

    Thread Starter master00

    (@master00)

    How do I attach an image to a post without actually inserting it is basically my question.

    I understand all the PHP codes, my template is set-up to handle thumbnails.

    My problem is that it only recognizes the thumbnail if it is embedded in my post.

    I just want to link a thumbnail to my post without inserting it. I click add image in a post and I add an image. But, unless I actually insert the image into the post it does not appear as a thumbnail.

    There has got to be a way to do this……

    Thread Starter master00

    (@master00)

    I figured it out. Apparently you need to upload the file and then set it as “featured image” for the post you want to assign it to. They could have made this much more straight forward if they labeled it “set as thumbnail”.

    yeah there’s a bit of a conflict there between the front-end and back end with featured image vs thumbnail.

    Hi! I have another question regarding this issue and hoping someone can possibly point me in the right direction. I’m fully comfortable with XHTML/CSS, but new to PHP and WP.

    I basically would like to use the thumbnails in the excerpts only; however, not in the actual post, as I would like to customize the post content myself. Right now the thumbnails display when set to “featured image,” but they also appear in the post, which I do not want.

    I’m trying to display the thumbnail, excerpt and a read more link, which will link to the individual post (sans thumbnail). These two sites demonstrate what I am trying to achieve.

    http://newwp.templatepanic.com/?themedemo=Scratch

    http://speckyboy.com/

    Any help would be greatly appreciated! I just can’t seem to find a solution online… Thanks much. πŸ™‚

    Sounds to me like you need to remove instances of the_post_thumbnail() from your themes single.php file so that when users click through to the full post the thumbnail will not show there.

    Thank you for your response! I actually thought of that, but am using the “Clean Home” theme, which does not contain the file single.php. I have index.php and page.php.

    I’m assuming page.php is similar to single.php?? Although, it does not contain any reference to the_post_thumbnail(), only refers to <?php the_content(‘Read the rest of this entry »’); ?> within the div .post class.

    Hmm…

    Have you got a link to the archive page you want the images to show on?

    Another strange thing about this theme, is that there is no archive.php file. Again, I’m new to WP so wasn’t quite sure as to what files were necessary for the structure.

    This is the theme I am using: http://wordpress.org/extend/themes/clean-home

    And this is the link to the site I’m creating with several stylistic changes (very, very rough with only a bunch of filler text). http://www.digitalcandyonline.com/blog/

    I just need to somehow remove the thumbnail from the individual post page, and only have it display in the post excerpt on the main blog page.

    Thanks again for your input! Thoroughly perplexed on this one…

    Therefore it is probably a call to <?php if(is_single() { ... } ?> that is causing the thumbnail to show on the single posts pages. This will probably be in index.php.

    Are you adding the image in the content of the post. Inside the WYSIWYG editor?

    No, I am setting the image using “featured image” in WP 3.2.1.

    This is the code inside my #content div in index.php (apologize if the formatting didn’t carry over):

    <?php if (have_posts()) : ?>
    
    	<?php while (have_posts()) : the_post(); ?>
               <div class="post">
                 <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
    	    <span class="serif"><?php the_time('m. d. Y') ?> </span>     <small> by <?php the_author_posts_link(); ?></small>
    
               <?php the_post_thumbnail('thumbnail'); ?>
               <?php the_content('Read More &raquo;'); ?>
    
           	   <small><b>Posted in:</b> <?php the_category(', ') ?> <?php the_tags(' | <b>Tags:</b> ', ', ', ''); ?> <?php if ( $user_ID ) :
    				?> | <b>Modify:</b> <?php edit_post_link(); ?> <?php endif; ?>| <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></small>
            <hr/>
    	 </div>
    
    	<?php comments_template(); ?>
    	<?php endwhile; ?>

    Replace this:

    <?php the_post_thumbnail('thumbnail'); ?>

    with this:

    <?php if(!is_single() ) { ?>
      <?php the_post_thumbnail('thumbnail'); ?>
    <?php } ?>

    That should only show the post thumbnail on pages that are not the posts permalink (single) page.

    Worked like a charm!! Thank you SO much for your help! Looks like it was only a simple line of code… Thanks again! I had been Googling a solution to this for weeks now…

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Show thumbnail in excerpt only?’ is closed to new replies.