[Support request] How to Place H1 Page Title and Featured Image in the Header

Home Forums Support [Support request] How to Place H1 Page Title and Featured Image in the Header

Home Forums Support How to Place H1 Page Title and Featured Image in the Header

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #836958
    Dax

    Thanks, Tom, looks great!

    I don’t seem to be able to get the featured image sizes quite right though. I’ve tried multiple different pixel dimensions. Tried cropping them and the results seems pretty hit and miss.

    What would you recommend?

    Thanks

    #837141
    Tom
    Lead Developer
    Lead Developer

    Did you use my PHP functions to size the images automatically? Or are you resizing them yourself?

    #837176
    Dax

    Hi Tom,

    I used the PHP functions to size the images automatically.

    #837869
    Tom
    Lead Developer
    Lead Developer

    And did you run that force regenerate thumbnails plugin that I mentioned?

    #838209
    Dax

    Hi,

    I ran the regenerate thumbnail plugin today, although I was notified that many images failed.

    However, I remain confused because images seem to act differently e.g. are sized differently in the page hero thumbnail, even though they have the same dimensions.

    For example, the featured image of these two pages appear to have the same dimensions (1024 by 512 pixels):

    1.https://bit.ly/2TAMmbs – prefer this one and would be desired for the whole site.
    2.https://bit.ly/2TDIBlx

    I have noticed that one is jpeg and the other is png format. Not sure if this makes any difference?

    #838252
    Tom
    Lead Developer
    Lead Developer

    Hmm, they don’t seem to be using that image size.

    Just to confirm, did you add these functions with your desired size?:

    add_action( 'after_setup_theme', function() {
        add_image_size( 'hero-image', 500, 500, true );
    } );
    
    add_filter( 'generate_hero_thumbnail_id_size', function() {
        return 'hero-image';
    } );
    #838317
    Dax

    Hi Tom,

    Yes that exact code was added using the snippets plugin and I have played around with the dimensions but no changes seem to take effect when I do.

    Just realized you mentioned desired image size…so what would that be for the example above?

    #838956
    Tom
    Lead Developer
    Lead Developer

    Hmm, strange. Can you try this code instead?:

    add_action( 'after_setup_theme', function() {
        add_image_size( 'hero-image', 500, 500, true );
    
        add_filter( 'generate_hero_thumbnail_id_size', function() {
            return 'hero-image';
        } );
    } );

    The first 500 is the width, and the second 500 is the height. That’s where you would input your own width and height depending on what you’re needing.

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.