• For example I have an image that’s very long but want to show a cropped version of that but when people click my blog post from the homepage they see the longer version.

    I tried doing multiple php functions with “hard crop” but I’m not getting why it wont work. Which is why at this point I just want to make 2 images – 1 for the homepage/ 1 for the blog post. Thanks.

Viewing 15 replies - 16 through 30 (of 41 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Just so you know, you should make a Child Theme before you do this change: https://codex.www.ads-software.com/Child_Themes

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Wait, is the image on your posts page just part of the post content (available when you edit the post)? Or is it automatically generated?

    Thread Starter deanmoney

    (@deanmoney)

    Thanks for the help but making a child theme seems like a lot of work for me right now over this. My theme is a free theme that I heavily modified over the years.

    All images on my homepage and post pages are the actual file sizes I upload myself for each post using the add media feature on wordpress.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It doesn’t look like you need to create a Child Theme after all. It sounds like you can just use the thumbnail that has been created when you uploaded the image now. That should appear when you go to insert the image into your post.

    Thread Starter deanmoney

    (@deanmoney)

    I just deleted the post image again but I’m not sure what to do after this. I don’t see any options for anything I want to do. Can you please be more specific if possible.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    https://codex.www.ads-software.com/Inserting_Images_into_Posts_and_Pages

    On step 3, can you choose the size you’ve created from this bit of code:

    add_theme_support( 'post-thumbnails' );
    add_image_size ( 'homepage-thumb', 600, 375, TRUE );

    Thread Starter deanmoney

    (@deanmoney)

    Yea…My 600X375 isn’t showing up as something I can select. Ok I’ve had it with this. Thanks.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    One last attempt. I see you’ve got a caching plugin active on your site. This may explain why the CSS I gave you had no effect.

    Can you try,

    1. In the WP Super Cache settings, can you clear its cache?
    2. Then deactivate that plugin
    3. Then activate that Custom CSS plugin
    4. And add that code in its Custom CSS setting (as per above instructions):
      .single-post .entry p:first-of-type img {
         height: auto;
         width: 200px;
      }
    Thread Starter deanmoney

    (@deanmoney)

    Ok I never added that code into that plugin because I thought that was child theme related.

    Ok I added the code you wanted and at least something changed lol My homepage is still full size but the post page is the 200 width that your code says.

    Now the question is how to flip that and be able to change the homepage image and crop it while keeping the post page the full length.

    Didn’t think something as simple as this would be this difficult/frustrating. Oh well ??

    Thread Starter deanmoney

    (@deanmoney)

    Also that code now changed all my past post pics…fun.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try this instead:

    .home .entry p:first-of-type img {
       height: auto;
       width: 200px;
    }

    Thread Starter deanmoney

    (@deanmoney)

    Ok that did work and now all my homepage pics are 200 width. I really just want to do this for 14 images and not my whole site.

    Also I would like to crop these 14 images like from top-ish to the center – 600×375 without affecting everything. Is that possible? Maybe a code I add in the post itself?

    Thread Starter deanmoney

    (@deanmoney)

    Ideally I want to have my homepage pics look like this for specific posts:

    https://www.bigbrotherhoh.com/wp-content/uploads/2015/06/meet-big-brother-17-houseguest-audrey-middleton-600×375.jpg

    Which I seem to be able to produce but not show up on the homepage… somehow.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I can’t see these 14 posts, I can only see 3 posts on the Home page. Are the other posts on another page?

    Thread Starter deanmoney

    (@deanmoney)

    No sorry I meant I plan to use this for 14 posts in total. Right now I just the first one up and 13 more will be posted later. Sorry for the confusion.

Viewing 15 replies - 16 through 30 (of 41 total)
  • The topic ‘How do I add a different blog post image for my homepage?’ is closed to new replies.