awesomemotive / one-click-demo-import

One Click Demo Import plugin
https://www.awesomemotive.com/
195 stars 84 forks source link

Images Import Issue #251

Closed Pixelous closed 3 years ago

Pixelous commented 3 years ago

Hi, @capuderg and other.

I use this:

function ocdi_after_import_setup() {
    // Set thumbnail size in settings > media
   update_option( 'medium_size_w', 0 );
   update_option( 'medium_size_h', 686 );
   update_option( 'large_size_w', 1170 );
   update_option( 'large_size_h', 0 );
}

But however image sizes are ok in Settings > Media looks like the plugin ignores them and uses the default one:

300 300

1024 1024

Can you please help?

Kind regards

capuderg commented 3 years ago

Hi @Pixelous,

I think you are just setting the image sizes WP settings for any new images that are added to your site. You would then have to also regenerate thumbnails after you change those settings. For example with this plugin: https://wordpress.org/plugins/regenerate-thumbnails/

Or you could try to set these thumbnail settings before the import begins. I see the function name is ocdi_after_import_setup, so I guess it's hooked in to the after_import OCDI action? Try to hook it to ocdi/before_content_import action and see if the images that are imported are generating the correct images sizes.

Take care!

Pixelous commented 3 years ago

@capuderg

:) Thanks!

ocdi/before_content_import works perfect!

Kind regards

capuderg commented 3 years ago

That's great! Thanks for letting us know.