[Resolved] modify image-size name on single.php

Home Forums Support [Resolved] modify image-size name on single.php

Home Forums Support modify image-size name on single.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #944387
    Colin

    Hi, it appears the featured image on single.php is added via hooks and using “full”.

    I would like to change the wp image size “name” to my custom name/dimensions. Could you point me in the right direction for this?

    Note: This is on single.php not archives.

    Thanks!

    #944686
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this:

    add_filter( 'generate_page_header_default_size', function( $size ) {
        if ( is_single() ) {
            $size = 'your-name-here';
        }
    
        return $size;
    } );

    Let me know ๐Ÿ™‚

    #947534
    Colin

    Worked! Thank you!

    #948039
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

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