• I’m trying to get thumbnails to show up on my theme.

    I’ve added the code to activate the thumbnail functionality in the functions.php document:

    add_theme_support( ‘post-thumbnails’ );
    set_post_thumbnail_size( 50, 50, true ); // Normal post thumbnails
    add_image_size( ‘single-post-thumbnail’, 400, 9999 ); // Permalink thumbnail size

    and then I added the call to the thumbnail:
    <?php the_post_thumbnail( $size, $attr ); ?>

    From what I understand that is pretty textbook. For some reason, it is not working. I do not get a thumbnail uploader on the admin page or any other options to “add post thumbnail”.

    I’ve installed and uninstalled several plugins that are supposed to do that, and they just don’t show up.

    I’m really annoyed and frsutrated but I can’t figure out what I’m missing, if I’m doing something wrong or what.

    Any ideas, suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jcaruso

    (@jcaruso)

    Okay. Here’s another weird thing:

    When I add a featured image, I can’t click it to go to the post.

    Furthermore, I get two featured images! It makes no sense.

    Thread Starter jcaruso

    (@jcaruso)

    Also, why does the image for the article take users to the thumbnail? How can I fix this so it takes them to the article, not a bigger picture of the thumbnail?

    when you add the call to the thumbnail, do you actually put: <?php the_post_thumbnail( $size, $attr ); ?>? That would be wrong…

    for your standard defined 50×50 thumbnail it would be
    <?php the_post_thumbnail(); ?>

    And for your added single-post-thumbnail it would be
    <?php the_post_thumbnail('single-post-thumbnail'); ?>

    to make the featured image link to the post permalink add

    // THIS LINKS THE THUMBNAIL TO THE POST PERMALINK
    
    add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
    
    function my_post_image_html( $html, $post_id, $post_image_id ) {
    
    	$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
    
    	return $html;
    }

    to functions.php

    And finally, image for the article links to whatever you tell it to. You have options on what to link it to when you upload

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘No thumbnail in admin, no thumbnail on page, no thumbnails’ is closed to new replies.