Featured image


Hi

Here is an example on hiding featured image on a single post and a page: https://community.getbeans.io/discussion/hiding-featured-image-on-specific-page/#post-2826

// Removes featured image on single post AND a page.
add_action( 'wp', 'beans_child_setup_document' );
function beans_child_setup_document() {
   if ( is_single() or is_page() ) {                    
        beans_remove_action( 'beans_post_image' );
    }
}

How would I go about choosing which to use for pages, posts or custom posts? What about adding additional options to the featured image such as align left/right/center/cover top just below the header having the title on top of the featured image or other modifications?

I am using the following code to resize the featured image:

/* --- Resize featured images: 
https://community.getbeans.io/discussion/default-featured-image-size/ --- */
add_filter( 'beans_edit_post_image_args', 'example_post_image_edit_args' );
function example_post_image_edit_args( $args ) {
    return array_merge( $args, array(
        'resize' => array( 250, true ),
    ) );
} 

Basically I am working on a site and at the same time a tutorial for using featured images in the Beans Framework. Thanks for your help.

Write a reply

Login or register to write a reply, it's free!