WordPress.org

Ready to get started?Download WordPress

Forums

post thumbnail not working - want thumbnail on homepage and full on single post (1 post)

  1. changostraw
    Member
    Posted 1 year ago #

    Hi,
    I have never had to post before because I always find the answer in forums somewhere. But this has really baffled me.
    I am trying to have the thumbnail size show up on index - which it is - but the full size show up on single posts.

    This is what I have in my functions.php right now:

    //enable post thumnail UI
    if (function_exists('add_theme_support')) {
    add_theme_support( 'post-thumbnails', array( 'post' ) );          // Posts only
    add_theme_support( 'post-thumbnails', array( 'page' ) );          // Pages only
    add_theme_support( 'post-thumbnails', array( 'post', 'movie' ) ); // Posts and Movies
    set_post_thumbnail_size( 256, 999, true ); //true = hard crop mode
    add_image_size( 'single-post-thumbnail', 9999, 9999 ); // Permalink thumbnail size
    }

    I have added extra just in case I want to remove something in the future. I also tried this without using the add_image_size function and just using the sizes that I set in wordpress media settings.

    this is in my loop for index:

    <?php
    if ( has_post_thumbnail() ) {
    	the_post_thumbnail('thumbnail');
    } ?>
    <div class="entry-content">

    this is in my loop for single:

    <?php if ( has_post_thumbnail() ) {
    	the_post_thumbnail('single-post-thumbnail');
    } ?>

    but I have also tried:

    <?php
    if ( has_post_thumbnail() ) {
    	the_post_thumbnail('full');
    } ?>

    and

    <?php
    if ( has_post_thumbnail() ) {
    	the_post_thumbnail('large');
    } ?>

    yet nothing makes a difference = only the thumbnail size gets posted to the single posts.

    does anyone have any ideas of what is going wrong?
    thanks

Topic Closed

This topic has been closed to new replies.

About this Topic