jcmrs / mk-nurture

Nurture Child Theme for the Beans Framework
https://mk-beans-jcmrs.c9users.io
0 stars 0 forks source link

Featured Image. Default size. #4

Open jcmrs opened 8 years ago

jcmrs commented 8 years ago

// Change default featured image size. // Issues: Yet no matter what I try, featured image still remains too small (max-width from small_args?), below device breakpoints too big. Regardless of functions, there appears to be a conflict. Post_image still gets attributes from elsewhere.

add_filter( 'beans_edit_post_image_args', 'mk_post_image_edit_args' );
function mk_post_image_edit_args( $args ) {
    return array_merge( $args, array(
        'resize' => array( 1600, 300, true ),
    ) );
}
add_filter( 'beans_edit_post_image_medium_args', 'mk_post_image_medium_args' );
function mk_post_image_medium_args( $args ) {
    return array_merge( $args, array(
        'resize' => array( 1200, 300, true ),
    ) );
}
add_filter( 'beans_edit_post_image_small_args', 'mk_post_image_small_args' );
function mk_post_image_small_args( $args ) {
    return array_merge( $args, array(
        'resize' => array( 800, 300, true ),
    ) );
}
jcmrs commented 8 years ago

<img width="1200" height="476" src="https://mk-pmo-jcmrs.c9users.io/wp-content/uploads/beans/images/vestigingen-7ad0e5b.jpg" alt="" itemprop="image" data-markup-id="beans_post_image_item">

Yet the image itself was resized as needed, to correct dimensions.

jcmrs commented 8 years ago
// Change default featured image size.
add_filter( 'beans_edit_post_image_args', 'mk_post_image_edit_args' );

function mk_post_image_edit_args( $args ) {

    return array_merge( $args, array(
        'resize' => array( 1200, 360, true ),
    ) );

}

add_filter( 'beans_edit_post_image_small_args', 'mk_post_image_small_args' );

function mk_post_image_small_args( $args ) {

    return array_merge( $args, array(
        'resize' => array( 800, 360, true ),
    ) );

}
jcmrs commented 8 years ago
// Alternative: let WP handle things.
// add_filter( 'beans_post_image_edit', '__return_false' );