• I’ve taken all the necessary steps to create my featured image and I can get it to display above my content in the post. The problem is that it won’t float to the left of my first paragraph that is within the post.

    <?php the_post_thumbnail('thumbnail');?>
    
    <?php the_content( 'Read More...' ); ?>

    I’ve also stylized the CSS that is associated with thumbnails.

    img.wp-post-image {
    	float: left;
    	margin: 5px 5px 0 0;
    }

    With all of this said and done, I still have the image floating above the_content instead of within. Is it not possible? I’m trying to stay away from inserting directly into the post for this certain template.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • There’s probably something in your css, that’s overriding your css.
    Please provide a link to your site, so we can have a look.

    Thread Starter get_username

    (@get_username)

    Hi Christine,

    Unfortunately, I’m programming this locally so no link is available. It does sound like you’re confident that it should work though, correct? I can’t imagine what other css would override it, but I guess anything is possible.

    Thanks,
    Burt

    Thread Starter get_username

    (@get_username)

    Hi again Christine,

    I found the offending line of css code. For some reason I had a clear on my P tags. Don’t ask me why I did this, but it works now. I do thank you for getting me to take a second look at my code as apposed to thinking WP didn’t support this feature.

    Thanks,
    Burt

    Thread Starter get_username

    (@get_username)

    Hi Christine,

    One more question. Is it possible to create an array that tells the image to come after an H1 tag? It works great if I just have a paragraph, but I do have posts where an H1 is thrown in and the image ends up sitting before the H1 instead of my paragraph. I wonder if there is some sort of code that is similar to other functions that call for a ‘before’ and ‘after’?

    Thanks,
    Burt

    mmmm.. that second question sounds a bit trickier. I don’t know of any such method.

    Glad the other issue got resolved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do you place a featured image into the post?’ is closed to new replies.