Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1299857

    i know that filter : avf_modify_thumb_size – and i can change the masonry size to f.e.:

    function enfold_customization_modify_thumb_size( $size ) {
    $size['masonry'] = array('width'=>1210, 'height'=>1210, 'crop' => false);
    return $size;
    }
    add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );

    but that will need a recalcultion of that size to take effect on my existing masonries.

    isn’t there a way to have by that a new-size :

    add_image_size( 'new-size', 1210, 1210, false );
    
    function my_custom_sizes( $sizes ) {
        return array_merge( $sizes, array(
            'new-size' => __( 'New Size' ),
        ) );
    }
    add_filter( 'image_size_names_choose', 'my_custom_sizes' );

    and to set this new-size as source for masonry thumbnails?

    ______
    For Example
    On av-helper-masonry.php i can see that function: prepare_loop_from_entries
    there we have : $img_size = 'masonry';
    is it possible to use the filter avf_masonry_loop_entry_content to change here the source ?
    Thanks

    #1300068

    Hey Guenter,

    Thank you for the inquiry.

    Have you tried using the avf_masonry_loop_prepare to assign a different attachment or image source for a masonry item? This is the current attachment value..

    //get attachment data
    				$this->loop[ $key ]['attachment'] = ! empty( $this->loop[ $key ]['thumb_ID'] ) ? wp_get_attachment_image_src( $this->loop[ $key ]['thumb_ID'], $img_size ) : '';
    

    .. and by using the filter you can change the value of the attachment and fetch an image with a different size.

    Best regards,
    Ismael

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