Image with description side by side

Yes, I think this is a great, fundamental question of WordPress editing and content creation by low-level users who are met with the big blank editing area and don’t know how to wrangle html. There are myriad answers: hardcore coding, softcore coding, plugins and everything in-between. The answer for me is Advanced Custom Fields. I … Read more

add_image_size landscape or portrait

What you’re asking for is functionally equivalent to scaling images to fit within a bounding square of each size, so could be achieved with this: add_image_size(‘big_xxl’, 4500, 4500); add_image_size(‘big_xl’, 3300, 3300); add_image_size(‘big’, 2100, 2100); add_image_size(‘medium’, 1250, 1250); Consider a landscape image that is 5000×500. These rules will generate images scaled to 4500, 3300, 2100 and … Read more

Editing built in Gallery shortcode to filter by categories

There are various ways to run another WP_Query with a tax query and collect the ID’s into the include attribute of the gallery shortcode. Let’s try another approach, without running a secondary WP_Query. Native gallery: Support taxonomy and term attributes We introduce the following custom gallery shortcode attributes: Here’s a demo plugin that supports that … Read more

How to change Thumbnail size of next Gen Gallery plugin?

For the specific display you will need to re-open the IGW by clicking on the preview image in the post/page then under the customizations tab change the override thumbnail size option to yes and set the dimensions as needed. You may need to clear your image cache under Gallery > Other Options > Miscellaneous to … Read more

How to prevent resized featured images?

Featured image sizes are mostly likely controlled by your theme, so I would look there. Maybe there is a theme setting for it. You can also check the following setting to see if it us using one of those sizes. You can change the featured image size by adding this code into your functions.php file. … Read more

Can’t access ‘Store uploads in this folder’

This is a very good question. The answer to the referenced post requires a change to the WP options. They are stored in the database in the wp_options table (assuming wp_ is your prefix). There are a few ways to change these in this case: Direct DB access: if you’re comfortable modifying the WP DB … Read more

How to make programmatic image upload generate thumbnail and sizes?

In order for wp_generate_attachment_metadata() to work properly in that it creates a thumbnail and other intermediate/image sizes like medium and large, the image attachment/post data must have the proper MIME type (post_mime_type), and despite you did set it in your $attachment array (the post data), there’s a problem with this part in your code: $wp_filetype … Read more

Is there a better way to implement responsive images than what WordPress uses by default?

Unfortunately, I’ve found the images within Gutenberg/block editor a lot left to be desired and the development work with images in 2020 has been primarily focused on adding cropping, rotating images within the block editor. The limitations of responsive images in the block editor is one of my biggest criticisms of the block editor. What … Read more