WordPress.org

Ready to get started?Download WordPress

Forums

Images not showing on homepage (4 posts)

  1. ckbrumb
    Member
    Posted 1 year ago #

    I'm having an issue getting my main/featured image to show on my homepage when I add a new post. I'm using the Skeleton Plus theme (the contact form to contact them was not working today).

    Basically, in every post I do I have an image at the top, aligned left so that the first paragraph or so wraps around it. The current site is a new project, but every other time I've ever worked with WordPress, no matter what theme, once I've submitted a post that image has shown up with the synopsis on the front page.

    Any suggestions?

    If you need to check it out, it's at http://www.oseh-writing.com

    Thanks,

    Carlton

  2. flashbuddy
    Member
    Posted 1 year ago #

    I think your link is wonky, and believe me, I know wonky when I see it.

    If you are editing display of a single post, start with editing single.php in your themes folder.

    Look for code that will call the featured image, find its id or class, and edit that id or class in your themes stylesheet.

    You say:

    but every other time I've ever worked with WordPress, no matter what theme, once I've submitted a post that image has shown up with the synopsis on the front page.

    So half the time it does, and half (every other) the time it doesn't. Getting wonky here...

    Theme developers have a choice whether or not to have a post display the featured image and how to align/style it, and wethor or not to include the full post, a post excerpt, how much of an excerpt, etc, etc, etc.

    A WordPress site may or may not have latest posts showing up on the front page. I'm curious why you mention that. Is it your intention to have new posts you create show up on the home or front page of the website with an excerpt and featured image?

  3. ckbrumb
    Member
    Posted 1 year ago #

    flashbuddy, thanks for the reply. I'll look at singles.php.

    Sorry about the link, it's supposed to be http://www.oseh-writer.com, not "-writing.com."

    As far as latest post showing up on the front page, that's been the default with any other theme I've worked with, including this one, so I'm not complaining about that. It does what I want. I'm just trying to figure out how to get the image to show up on the home page/recent posts.

  4. flashbuddy
    Member
    Posted 1 year ago #

    That is easy enough. My approach is to grab the featured image url with:

    <?php if (has_post_thumbnail( $post->ID ) ): ?>
    <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    <?php echo $image[0]; ?>
    <?php endif; ?>

    From there I integrate timtumb.php to size it on the fly to my custom size, then wrap it together in an image tag, stick it in a div with a class then style it with css. See my complete code here:
    http://pastebin.com/M1QP9ZN3

Topic Closed

This topic has been closed to new replies.

About this Topic