Best option for photo/gallery handling?

You can keep your whole site together, i.e. texts and images, the main suggestion: just don’t mix up large image/galleries with your text stream, this will indeed slow down your site loading. While most bloggers want display their pictures at any cost, most visitors just want read a specific text, then this approach become annoying … Read more

How to change image url?

Go into your WordPress Dashboard > Settings > Media and then untick the option that says Organize my folders into Month and Year based folders This will make it look like: http://example.com/wp-content/uploads/imagename.jpg Then to take it further you need to update you config.php file and add in either this line: define( ‘UPLOADS’, ‘image/’.’files’ ); This … Read more

Rename image file by post title

I think what you’re looking for is the filter: wp_handle_upload_prefilter. From the Codex: The single parameter, $file, represent a single element of the $_FILES array. The wp_handle_upload_prefilter provides you with an opportunity to examine or alter the filename before the file is moved to its final location. Example code from the Codex: add_filter(‘wp_handle_upload_prefilter’, ‘custom_upload_filter’ ); … Read more

Get full image array

The “full array” is constructed by Advanced Custom Fields from various sources. It’s not a format that occurs natively in WordPress. If you want to output an image tag for an image with all the correct attributes, just use the ID with wp_get_attachment_image(). That returns an HTML <img> tag with the src, width, height, alt, … Read more

hardcrop images in gutenberg “latest posts” block

The Latest Posts block uses (wp.data.select( ‘core/block-editor’ ).getSettings() to get) the image sizes in the editor settings which can be filtered via the block_editor_settings hook in PHP: apply_filters( ‘block_editor_settings’, array $editor_settings, WP_Post $post ) Filters the settings to pass to the block editor. And the setting name used for the image sizes is imageSizes. So … Read more

Is there a way to get attachment data?

Don’t forget that attachments are just posts (though they are native posts and those tend to be a special case). Thus simply get_post() on attachment ID should get you typical post object for it. 🙂 Similarly all API functions that work on posts should work on attachments.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)