• My blog is theyoungbigmouth.com, everything else works, just that the featured images are not displayed on top of blog titles on the home page. I am updating to 4.4.1 to check if that works

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey There,

    The documentation is your friend, I learned this the hard way.

    https://codex.ww.wp.xz.cn/Function_Reference/the_post_thumbnail

    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
        the_post_thumbnail(
            array(
                'src'   => $src,
    	    'class' => "attachment-$size",
    	    'alt'   => trim( strip_tags( $wp_postmeta->_wp_attachment_image_alt ) ),
    	    'title' => trim( strip_tags( $attachment->post_title ) )
            )
        );
    }
    ?>
    Thread Starter theyoungbigmouth

    (@theyoungbigmouth)

    I am sorry, but I insert this bit of code where?

    I am more of a writer than a coder, but can insert the code once i know where

    @theyoungbigmouth – the posts on the home page all appear to have images above the titles. Is there another problem you’re referring to?

    It all depends on where you are putting the image.

    – If it is on an archive page then probably archive.php
    – If on a single post then single.php
    – If on a template then search files for Template Name:

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Featured image not displayed’ is closed to new replies.