• Hi Robin,

    Thanks for all your quick responses on this forum. Super impressive! I’d love to send a few bucks your way as plugin payment if there’s a way to do that.

    For my question, I’d like to make it to where the default image applies to only Posts, not Pages, and where it shows in place of the post featured image. Is there simple piece of code I can add to do that?

    I’m basically wanting to use this as a branded blog header that doesn’t affect the rest of my site.

    Thanks for your time!

    https://www.ads-software.com/plugins/display-featured-image-genesis/

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

    (@littlerchicken)

    Yes, you can definitely do that. The snippet you want is on the FAQ page, and you should be able to use it without modifications. Look for “To force a post type to use the sitewide Featured Image….”. The example snippet there is already set to modify the featured image output for posts.

    Thanks so much for the kind words! If you would like to support the plugin financially, there is a donate link under my author photo on the FAQ or main plugin page here on the repo. I appreciate it.

    Thread Starter liledit7

    (@liledit7)

    Thanks Robin! That’s super close to what I need. Only problem is that I don’t want a featured image displayed on most of my pages. Is there another filter I can add so that the default image is not applied to pages?

    Plugin Author Robin Cornett

    (@littlerchicken)

    The filter for that is very similar–it is the display_featured_image_genesis_skipped_posttypes filter, with an example just above the default example. You’d just set the $post_type[] as 'page'. If you want to get a bit more complex, and show the featured image on pages which actually have it, and not on pages which don’t have a featured image, you can modify the filter with a conditional, something like:

    add_filter( 'display_featured_image_genesis_skipped_posttypes', 'rgc_skip_post_types' );
    function rgc_skip_post_types( $post_types ) {
    	if ( ! has_post_thumbnail() ) {
    		$post_types[] = 'page';
    	}
    
    	return $post_types;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I apply Default Image To Posts Only (with override)’ is closed to new replies.