Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Option to show/hide featured image by post

  • brunoramoslara

    Hi, I have disabled the featured image in post by default (my former theme didn’t support it), but for new post, I wan to have an option to select the featured image, is this posible?

    Thanks!

  • Hi there,

    There is an option in the post editor to hide featured image, but if you disable all featured images in the customizer, then the option doesn’t work, since there’s no featured image to hide.
    https://docs.generatepress.com/article/layout-metabox-overview/#where-is-it

    Just to confirm, your goal is to hide all featured images for older posts, and have the option to show or hide featured image for new posts?

    If so, it might require custom coding.

    Let me know 🙂

  • brunoramoslara

    Thanks Ying,

    My point is this: all my post doesn’t have featured image, so, the categories shows the manual extract that I configured with the “read more” tag in every single post over 11 years… yes, I know 😅

    If I set the featured image in the customizer, doesn’t show anything in categories (only the title, logically), so my idea is stablish a featured image for each old post, and for the newest, asign a featured image, and delete the in content image to avoid duplicate phothos.

    This is te reason of my doubt, if there is an option to select manually wich post can show the featured image.

    Thanks!

  • Hi there,

    ..if there is an option to select manually wich post can show the featured image.

    I think you can utilize the Page Hero – Block Element to show the featured image. Under the Display Rules, you can select which post you want the featured image to show.

    https://docs.generatepress.com/article/block-element-page-hero/

  • brunoramoslara

    Thanks Alvind

    Finally I find out an automated solution:

    With this plugin, I configured the first image at post as a featured image:
    https://wordpress.org/plugins/auto-post-thumbnail/

    With this filter, overraided the read more tag:

    add_filter( 'generate_more_tag', '__return_empty_string' );

    Source

    And finally, with this, deactivated the excerpt in archive pages:

    
    /*
    	Remove excerpts from the achrive pages only
    */
    
    add_filter( 'wp_trim_excerpt', 'db_excerpt_metabox_remove' );
    function db_excerpt_metabox_remove( $excerpt ) {
    	$output = $excerpt;
    	
    	if ( is_archive() && has_excerpt() ) {
    		$output = '';
    	}
    	
    	return $output;
    }
    

    Source

    Regards

  • Awesome, glad you managed to find the solution!

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