Open srikat opened 4 years ago
+1
Please
+1
Would be helpfull
👍🏼
Yes thank you!
+1 Seems pretty fundamental!
+1 would be great!
+1 👌🏼
Yes please. +1.
Please, please!
+1
+1 it would be great
This is already working, but the only sizes that appear in the dropdown are specific to the image currently selected. So usually regenerating thumbnails after creating the custom image size then refreshing Oxygen will make them appear in the dropdown (if that image has this size available)
I just mentioned at the bottom of this post..
https://wpdevdesign.com/using-responsive-srcset-images-custom-image-sizes-in-oxygen/
Custom image sizes should also be available to pick in other places.
https://github.com/soflyy/oxygen-bugs-and-features/issues/433
+1
+1
+1
What the....!!! This is still an open Bug?
+1
+1
+1
+1
+1
+1
+1000
+1
This is must for speed workflow
+1
++
To all +1 posters: Also click on the thumbs up icon in the first post to make this go higher when sorting by thumbs up.
Also, check #433 which is related.
+1
+1
+1. This feature is needed a lot :)
This is already working, but the only sizes that appear in the dropdown are specific to the image currently selected. So usually regenerating thumbnails after creating the custom image size then refreshing Oxygen will make them appear in the dropdown (if that image has this size available)
This is not correct in my experience. For some reason the image sizes are note populated, even after regenerating thumbs. This feature does not work.
+1. Needed a lot.
This is already working, but the only sizes that appear in the dropdown are specific to the image currently selected.
Even if it would have worked like this, this is not the correct behavior. The drop-down should not be limited to the currently selected image's sizes. Images and their sizes are in continuous flux during development. If an image size has been registered with add_image_size
it should appear in the dropdown.
Thank you @d-packs , it really does. I added custom image size declaration to custom functionality plugin and it worked. The only hinder was to find out an appropriate way to regenerate thumbnails. And built in WP-CLI support for that helped a lot. WP-CLI can selectively regenerate thumbnails for array of IDs.
Add this to CodeSnippets and activate
add_theme_support( 'post-thumbnails' );
add_image_size( 'image-480', 480, 9999 );
add_image_size( 'image-640', 640, 9999 );
add_image_size( 'image-720', 720, 9999 );
add_image_size( 'image-960', 960, 9999 );
add_image_size( 'image-1168', 1168, 9999 );
add_image_size( 'image-1440', 1440, 9999 );
add_image_size( 'image-1920', 1920, 9999 );
add_filter( 'image_size_names_choose', 'custom_image_sizes' );
function custom_image_sizes( $size_names ) {
$new_sizes = array(
'image-480' => __( 'Size480', 'text-domain' ),
'image-640' => __( 'Size640', 'text-domain' ),
'image-720' => __( 'Size720', 'text-domain' ),
'image-960' => __( 'Size960', 'text-domain' ),
'image-1160' => __( 'Size1160', 'text-domain' ),
'image-1440' => __( 'Size1440', 'text-domain' ),
'image-1920' => __( 'Size1920', 'text-domain' )
);
return array_merge( $size_names, $new_sizes );
}
How to use it in repeaters see next comment
To use proper file size in dynamic data in repeater insert a function in code snippets /**
return wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $size)[0]; }
in data dialog select Advanced (php function return value)
insert 2 parameters: Function name right_image_filename Name of registered size image-489
and voila Works like a charm
To use proper file size in dynamic data in repeater insert a function in code snippets /**
- Returns the file name of right size of image
- @param string $size registered name of image size
- @return string proper filename of image . */ function right_image_filename( $size ) {
return wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $size)[0]; }
in data dialog select Advanced (php function return value)
insert 2 parameters: Function name right_image_filename Name of registered size image-489
and voila Works like a charm
This works wonderfully. Excellent work.
vadimbk's answer worked perfecty!
Anyone found a workaround for using the same custom image sizes for the background images of sections and DIVs?
This would be equally useful!
Thank you
Oh yes much needed
+1
I just saw this thread here and I've been using this bit of code (that I add in Code Snippets) which adds the custom image sizes to the Oxygen Builder options. I can't actually remember where I found it, but maybe it's of help to others?
add_image_size( 'custom-image-one',500,325, true );
add_image_size( 'custom-image-two',1920,400, true );
/* use this to insert with PHP
the_post_thumbnail( 'your-specified-image-size' );
*** For use with the Oxy 'PHP function return value' data field ***
get_the_post_thumbnail_url( ,'your-specified-image-size' );
*/
// Add our custom sizes to list of default image sizes
add_filter( 'image_size_names_choose', 'lit_merge_images_sizes' );
function lit_merge_images_sizes( $sizes ) {
return array_merge( $sizes, array(
'custom-image-one' => __( 'Custom Image One' ),
'custom-image-two' => __( 'Custom Image Two' ),
) );
}
Custom image sizes (registered using
add_image_size
) do not appear in the Size dropdown for images.Please consider fixing/adding this.
It would also be good if custom image sizes are read and shown in all other places where image size can be selected. Ex.: https://github.com/soflyy/oxygen-bugs-and-features/issues/433.