• Hi Robin,

    First, thanks for your plugin, I love it.

    I’ve been having a little issue. When the image displays as a backstretch.. it takes too long to show up. You told me that the backstretch image doesn’t load until the post is completely loaded. I understand that, but since that might take one or two seconds, some people just scroll down without even seeing the featured image.

    I noticed that when I change the image size, making it smaller, it shows above the title, and it loads much faster.. so I’d like to show all my featured images above title.

    Is there any way to show all my featured images above the title (not as a backstretch) without going one by one to all my posts and changing the image sizes manually? Maybe some custom CSS?

    If you wanna have a look: https://www.travelsauro.com/best-dive-camera-review/

    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    CSS alone won’t prevent the backstretch script from running, but you can do what you want with a filter as detailed in the FAQ under “How can I change how the plugin works?”. There are a couple different filters you can use. One option would be to change what post types prefer the large image with something like this:

    
    add_filter( 'display_featured_image_genesis_use_large_image', 'leaven_always_use_large_image' );
    /**
     * Force Display Featured Image for Genesis to always use the large image, not backstretch.
     * @param $post_types
     *
     * @return array
     */
    function leaven_always_use_large_image( $post_types ) {
    	return get_post_types();
    }
    

    I’m doing something similar in a current theme with a slightly different filter for posts only (see the conditional in this one):

    
    add_filter( 'displayfeaturedimagegenesis_image_size', 'leaven_display_featured_image_size' );
    /**
     * Change the featured image size for singular posts.
     * 
     * @param $size
     *
     * @return string
     */
    function leaven_display_featured_image_size( $size ) {
    	if ( is_singular( 'post' ) ) {
    		return 'large';
    	}
    
    	return $size;
    }
    

    Either of these should do what you want to replace the backstretch image with a smaller one, but you don’t need both. You can add the code to your theme’s functions file–just please practice safe coding and have a backup ready, etc. HTH

    Thread Starter travelsauro

    (@travelsauro)

    Awesome Robin!

    I’ll have a look at those filters! That’s what I was looking for.

    Thank you very much!
    Miguel.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change the image from backstrech to image above the post’ is closed to new replies.