Support » Themes and Templates » How can I change the size of my posts content thumbnails?

  • It seems like this should be really easy to do. I have tried putting a functions.php in my child theme folder and adding:
    if ( function_exists( ‘add_theme_support’ ) ) {
    add_theme_support( ‘post-thumbnails’ );
    set_post_thumbnail_size( 150, 150 );

    and this changes nothing.
    I also tried creating a content.php in my childtheme folder and adding values in the parenthesis on this line:
    <?php the_post_thumbnail(); ?>

    and this is not changing anything either.

    the site I am working with is – thanks in advance for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • paulwpxp


    Font hero

    Did you assign an image to be the featured image of that post/page yet ?

    Which part of the template that you place the_post_thumbnail() in ?

    Do you see the <img/> in the frontend at all, if so what are the classes there ?

    I just opened the content.php and put some values in – the line was already there…



    Font hero

    the_post_thumbnail() must be used inside the loop, the file name content.php alone doesn’t guarantee if it’s inside the loop, it depends on how the theme is constructed.

    So, just check if it’s called inside the loop.

    Second, make sure if it’s the right content.php. If the theme is using content.php as standard WP theming, make sure that the post/page you are viewing is really using the default content.php ( because you said you place the_post_thumbnail() inside this file ). For emample, if the theme has post formats and the content-format.php is being used, or it might becontent-page.php

    The <img/> echoed to the front will tell if the_post_thumbnail() works, it will output the correct classes.

    If everything’s done right BUT you didn’t assign the image to be a featured for that post/page, you are not gonna see it output as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I change the size of my posts content thumbnails?’ is closed to new replies.