Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] clarification on double featured images

Home Forums Support clarification on double featured images

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #170689
    cath

    Hi Tom, A few months back, I had asked about the double featured images showing up and I understand that maybe that happens when it is a full post?

    Separately, you gave me code to set the first post as full and the remainder excerpted. That I have tried on a test site and it worked!

    You also gave me code to remove the double featured images which is this:

    .blog .entry-content img,
    .archive .entry-content img {
    display: none;
    }

    Does this go in functions.php?

    You have to set a featured image. So if my first post is full length, it will automatically always show two images? That seems a little clunky. I have not found that in other themes.

    Thanks so much.

    Cathryn

    #170695
    cath

    p.s. I just realized that this is CSS code. but clarification on is this best, given above scenario, would be helpful. thanks.

    #170697
    cath

    Okay, I just added that CSS via plug-in (WP Add Custom CSS) and nothing happened – there are still two images.

    But, in thinking this through further, the problem is that this site is 8 years old and there are a lot of posts (over 1000) that did not have featured images set. I used a plug-in to add them in but I dont think they all are.

    Right now, I am testing this all out on a test site before I try it on the larger site so I just want to work out as many kinks as possible.

    Thank you!

    #170809
    Tom
    Lead Developer
    Lead Developer

    Hi Cath,

    The issue here is this:

    When your blog is set to display full posts, it will also display images and other HTML in the post. This means it will show the image you’ve added inside your post.

    Now, when you also set a featured image (for excerpts to show an image), your full posts will now show two images – the featured image and the image inside the content.

    The best thing here is to choose one or the other when adding the posts in the first place – of course, this isn’t always possible.

    If you’d like to link me to your site I can see why both are still showing with that CSS 🙂

    #170844
    cath

    Hi Tom,

    Thanks for your response and the explanation. I think I read you just had a baby so you have a lot going on and congratulations!

    So, now better understanding, a few things. I am numbering them for clarity.

    1)With a lot of themes now, you *have* to set featured images so if I changed themes again in the future, that might later be a problem – plus many of the recent posts have already been set up with featured images. Even if I stopped setting them, these would still exist.

    2) Beyond the first post – which is set up for full post (with the added code) – the other post is also showing double images once you click past the excerpt. (And I know you said you would check why, site link is below. Thanks.)

    3) I just added a new post without featured image set and the photo did not show up on home page.

    4) Setting the dimensions of the post image under the Blog Add-On seems to crop the images in odd ways vs. other themes have thumbnails set up that use the whole image but reduced to a smaller size. Is there any way to do this?

    The site is just a test site right now but it is http://aromatherapystar.com

    Thanks so much.

    Cath

    #170928
    Tom
    Lead Developer
    Lead Developer

    Thanks! It’s been a very, very tiring week to say the least 🙂

    1. You don’t have to add a featured image, it’s totally up to you. Other themes will use the featured images in different ways as well.

    2. Ah, you can fix that with this CSS:

    .page-header-image-single {
        display: none;
    }

    3. That’s because of the CSS we added:

    .blog .entry-content img,
    .archive .entry-content img {
        display: none;
    }

    The above removes the images from the content on the blog page so your featured image is the only image showing. We can do the opposite if you like?

    4. You can crop proportionally by adding 9999 to the height or width – whichever one you want to resize based on the other value.

    Let me know if you need more info 🙂

    #171039
    cath

    Thanks, Tom. I can imagine re: the past week!

    UPDATED: I am leaving what I wrote below although I believe, with your suggestions, I figured out what will work: which was adding code suggested in #2 and removing #3 code which was previously there. This seems to be a good workaround. And the proportional worked also! Thanks!!

    PREVIOUS: Okay, I will try these things. Thanks! I am a little confused about the double featured image in the theme in general. I was resistant in my old theme when (I believe after a WordPress upgrade) I saw featured images had to be set but I soon saw some value because sometimes you might want to * feature * / have a thumbnail of a different image than the first one and that is also highlighted on Facebook, etc. Do some people want to have double images in a post? Or are you not that keen on featured images? I am asking to understand and also because if it was set up otherwise, it would be easier for me (and maybe others). 🙂 Although then if every post needs a featured image to show the thumbnail (which I think you said yes? is that right?), then that can have other issues.

    Thanks very much.
    Cath

    • This reply was modified 4 years, 9 months ago by cath. Reason: updated info
    #171047
    cath

    one other, Tom:

    you wrote:

    4. You can crop proportionally by adding 9999 to the height or width – whichever one you want to resize based on the other value.

    ***
    Maybe I did this wrong. I tried 2509999 and 1509999 for the width in Blog add-on under Post Image but the images remained full size. And when I do that, when it works, will the first one stay full size (it has the added code to make full-length)?

    Thanks!

    Cath

    #171120
    Tom
    Lead Developer
    Lead Developer

    You would want to put only 9999 in the size you want WP to figure out – without the 250 and 150.

    Let me know 🙂

    #171291
    cath

    Hi again Tom,

    Thanks for all your advice. Two things related to the above that we discussed:

    1) I added the 9999 in the post image section at the width – and no change. That is here: http://aromatherapystar.com where I tested it out.

    2) I thought I had the resolved the featured image issue – but when I added the code to functions.php at the other site I am working on – and I had already added code option #3 to CSS [.page-header-image-single {
    display: none;
    } ] ,

    the first image on my blog showed up full with two featured images. When I tried to delete the featured image and remove it on that first post, I removed it, saved, and it still appeared. I tried this twice and for some reason it would remove it so I continued to have two featured images. I removed the functions.php code for now.

    Is there any way to solve my problem? I admit I am now a little confused between CSS #2 and CSS #3 (that we discussed above).

    I would like the first post to be full length with just one image. I like to set featured images in general but in theory could avoid doing so. I do not want double featured images showing on the old posts that already have this set.

    THANK YOU.

    Cath

    #171324
    Tom
    Lead Developer
    Lead Developer

    Hi Cath,

    1. That image (of the flowers?) doesn’t seem to be using the page header or featured image. Is it just added to the content?

    2. That code should be added to your CSS, not functions.php: https://generatepress.com/knowledgebase/adding-css/

    We’ll get there! Let me know 🙂

    #171354
    cath

    Hi Tom, thanks for your positive attitude!

    1) I did not make the top flower a featured image because I was testing it out to see if the code worked to have the image appear on the home page without being set as featured ?

    2) The code was added to the CSS. The functions.php code added was related to making the first post full length.

    It seems some of the code messed with the original intention. So it feels like an either / or? But maybe not?

    The issues now:

    1. the featured images (which at this point I am very confused).

    2. the image being reduced without cutting off parts of it (keeping it whole but smaller)

    New:

    NOTE ** If it is better to put these questions as stand alone questions (for search or clarity), just let me know. 🙂 **

    3. I seem to have the Scroll back to Top under Layout on the one site (aroma) and not the other (wash s.). Would I have set something that made that hidden on one site?

    4. I am wondering on the home page, is it possible to have First post full-length, then perhaps four posts excerpted horizontal in a row, and then go into two columns side by side with thumbnails? Is that sections or something else?

    Thank you!

    Cath

    • This reply was modified 4 years, 9 months ago by cath.
    #171452
    Tom
    Lead Developer
    Lead Developer

    Hi Cath,

    1. Gotcha – so are you wanting to set it as the featured image or leave it as is?

    2. What code did you add to functions.php?

    3. You’ll need to update to the latest version of GP to get that functionality.

    4. You can do the first post full width and then choose columns using the Blog add-on, but you can’t do one column, 4 colums and then 2 columns. For that you might need to use a Page Builder plugin.

    #175238
    cath

    Hi Tom,

    Sorry for the delayed response. Hope things are well. I had to take a little break but now it is not as fresh in my mind but I will give it a go:

    1. I like featured images but I do not want the image to show up twice in a post when it is set.

    2. I would like the first image to be full length. The code I inserted in functions.php is from this page:
    https://gist.github.com/generatepress/5009727fe1b9fdba37b4

    3. I think the reason I possibly do not have latest GP working on the one site (W Sq) is because my WP is outdated there but hopefully I will update soon. (For the scroll to top to work)

    4. If the first post is full length, and you use I think it columns via Masonry (?), I would like two posts with images (thumbnails) side by side of the same exact size. When I watched the video and when I previously tried to set this up, they come up different sizes. I want them uniform. How do I do this?

    Thank you !

    Cath

    #175360
    Tom
    Lead Developer
    Lead Developer

    Hi Cath,

    1. You can remove the featured image from the single post page using the CSS from #2 here: https://generatepress.com/forums/topic/clarification-on-double-featured-images/#post-170928

    That will prevent it from showing up twice if you have the same image in your content.

    You can also use the Disable Elements add-on to remove it on a per-post basis.

    2. That code should work – is it not? Can you link me to the page?

    3. As long as you’re not using a crazy old version of WP you should be good to update either way. You should update WP though 🙂

    4. Have you tried setting the image sizes in “Customize > Blog > Post Images”?

    That will allow you to set them to the same size.

Viewing 15 posts - 1 through 15 (of 30 total)
  • You must be logged in to reply to this topic.