- This topic has 10 replies, 4 voices, and was last updated 4 years, 8 months ago by
Leo.
-
AuthorPosts
-
July 29, 2021 at 11:01 pm #1876587
nomadiceman
I’ve added the below new size:
add_action( 'init', function() { add_image_size( 'new-featured-image', 800, 600, true ); // 800 width, 600 height, crop } );I can select these size in the customiser for the featured image, but it does not show in the standard WordPress image block
The options showing in the WordPress image block in a post is the stand small, medium, large
Any ideas how I can get the new size options in the image block?
* I have regenerated all sizes fyi
July 29, 2021 at 11:20 pm #1876617Elvin
StaffCustomer SupportHi there,
Can you try disabling ALL plugins and see if it appears? Some plugins (usually image optimization plugins) are known to mess with this. It’s worth a try.
If it doesn’t can you try temporarily changing to a default WordPress theme and check again?
Let us know.
July 30, 2021 at 1:34 am #1876738nomadiceman
Hi,
Ok so I’ve just disabled all plugins, the issue was still there
I then switched to Twenty Twenty One theme and that also didn’t fix the problem
The new size is not showing in the standard WordPress image block
Any ideas?
July 30, 2021 at 6:57 am #1877078David
StaffCustomer SupportHi there,
the Image size will only display the sizes available for the image you selected.
If you added the code after images were uploaded you will need to run the Regenerate Thumbnails plugin to create your new custom size.You can quickly test this by uploading a new image, as WP will automatically create the sizes for new images.
If theres still an issue, then clear any plugin / browser caches
July 30, 2021 at 2:16 pm #1877754nomadiceman
Hi guys,
I did the regenerate again to make sure.
I’ve got all plugins off. No caching. Twenty twenty theme
And still no image size option in standard image box
Im using wp 5.8
Any ideas? Driving me crazy 😜
July 30, 2021 at 2:58 pm #1877785nomadiceman
I’m not a coder do I do struggle with it
I’ve seen this post and it seems I need to add extra code. Additional to the ones you suggest
https://wpmudev.com/blog/wordpress-image-sizes/
What do you think?
This part they say is needed for it to show in the image drop down
<?php add_filter( 'image_size_names_choose','wpmudev_custom_image_sizes' ); function wpmudev_custom_image_sizes( $sizes ) { return array_merge( $sizes, array( //Add your custom sizes here 'custom-image-square' => __( 'Square' ), 'blog-width' => __( 'Blog Content Full Width' ), ) ); }What do you suggest?
Thanks again for you help 🙏
July 30, 2021 at 3:13 pm #1877794Leo
StaffCustomer SupportI would say go ahead and try the code and see if it works for you.
If not then you can mention this to WP’s support team and see if they have a suggestion.
GP cannot control the standard image block from WP.
July 30, 2021 at 3:16 pm #1877796nomadiceman
yeah ill give it a try
I was hoping this issue may have arisen before and been resolved already haha
July 30, 2021 at 3:16 pm #1877798Leo
StaffCustomer SupportSounds good 🙂
July 30, 2021 at 3:59 pm #1877816nomadiceman
Oh, I’ve figured it out.
I just added the part of the code from wpdev site that shows the options in the drop down.
and change the name of the images to what I use:
<?php add_filter( 'image_size_names_choose','wpmudev_custom_image_sizes' ); function wpmudev_custom_image_sizes( $sizes ) { return array_merge( $sizes, array( //Add your custom sizes here 'custom-image-square' => __( 'Square' ), 'blog-width' => __( 'Blog Content Full Width' ), ) ); }now the sizes show in the gutenberg image block
🙂
July 30, 2021 at 10:08 pm #1877947Leo
StaffCustomer SupportThanks for sharing your solution!
-
AuthorPosts
- You must be logged in to reply to this topic.