ThemeShaper Forums » Thematic

[closed]

Thumbnail on Category listing ONLY; Full size img on post. HOW?

(9 posts)
  • Started 9 years ago by rkread
  • Latest reply from rkread
  • This topic is not resolved
  1. rkread
    Member

    I'm using a Thematic child theme. I'd like to show thumbnails with the excerpts on the Category pages, but NOT on the main post page. How do I do this?

    I've put the following code in my functions.php and unfortunately I can't get it to work.

    add_theme_support('post-thumbnails');
    
    	set_post_thumbnail_size( 250, 250, true ); // 250 pixels wide by 250 pixels tall, hard crop mode
    
    function my_post_title($title) {
    	if (is_category()) {
    		return get_the_post_thumbnail(NULL, 'thumbnail') . $title;
    	} else {
    		return $title;
    	}
    }
    add_filter('thematic_postheader_posttitle', 'my_post_title');

    Thank you!!

    Robin

    Posted 9 years ago #
  2. rkread
    Member

    Still hoping someone can push me in the right direction at least...please? thanks so much...

    Posted 9 years ago #
  3. Hi rkread,

    This code is fine. I tested it and it works for me. Here's my usual list of annoyingly simple questions:

    1. Have you made sure that your child theme is the active theme?
    2. Have you added a post thumbnail in the write panel?
    3. Have you edited the functions.php in the active theme?

    -Gene

    Posted 9 years ago #
  4. rkread
    Member

    Gene,

    Thank you very much for responding. I appreciate the simple questions. I realized I was testing it with a post that uses a NextGen Gallery, which, unfortunately still doesn't work. When I just retested with another post and a regular, single image, it worked.

    There is no "Use as thumbnail" link in the "Add an Image" pane when trying to select an image from a NextGen gallery. I realize I should probably look elsewhere for the answer to this question but if you happen to know--I'll be watching this space.

    In terms of the thumbnail's placement in the post--should I use css for that?

    Thanks again for your help.

    Robin

    Posted 9 years ago #
  5. rkread
    Member

    I'd like to customize the placement of the post thumbnails on the category page. Assuming I"ll need to put the thumbnails in a DIV to style with CSS, what is the code needed to do that and how do I integrate it with the code that I'm currently using (see above)?

    Again, patience for PHP newbies much appreciated. I'm fine with CSS, just getting familiar with PHP however. Thanks!

    Posted 9 years ago #
  6. @rkread: If it's any help, I believe WordPress does add an automatic class(es) tag to the post thumbnail: attachment-post-thumbnail and wp-post-image so you could get away with having no div tag.

    Otherwise, maybe could consider:

    if (is_category()) {
    		$title = '<div class="something">' . get_the_post_thumbnail(NULL, 'thumbnail') . get_the_title() . '</div>';
    	return $title;
    Posted 9 years ago #
  7. rkread
    Member

    @flick: thanks for the advice. unfortunately, couldn't get either approach to work for me.

    maybe my css skills don't go deep enough--but I couldn't get the entry title and text to wrap the thumbnail image for some reason.

    as for the php, that particular snippet does create a div for the img, but it wraps the post title in the div with it and removes its style.

    Any other suggestions? thanks again.

    Posted 9 years ago #
  8. lqunta
    Member

    Greetings Guys,

    Tried out the code above. The code completely replaces the post title with the post thumbnail. How can I display both the post title, then the post thumbnail, then the post excerpt?

    Posted 9 years ago #
  9. rkread
    Member

    @lqunta: since this code worked for me I'm not sure if I have the skills to figure out your specific issue, but you may want to check out these related threads that helped me:

    http://forums.themeshaper.com/topic/how-to-add-thumbnails-to-category-pages

    http://forums.themeshaper.com/topic/how-to-enclose-post-thumbnail-in-ltdivgt-to-modify-positioning

    http://forums.themeshaper.com/topic/adding-post-thumbnails-to-monthly-archives

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.