Cannot get full thumbnail size using the_post_thumbnail

Try to add custom thumbnail size with unlimited(very big) hegiht and width in functions.php with following code: add_theme_support( ‘post-thumbnails’ ); add_image_size( ‘custom’, 9999, 9999 ); It will not crop any images. So you can use it as the_post_thumbnail( ‘custom’ ); This method looks rough but you can use if other ways don’t work. And if … Read more

How to get category image custom post type taxonomy in wordpress?

From the details page of the WPCustom Category Image Plug-in : https://wordpress.org/support/plugin/wpcustom-category-image 1st – Go to Wp-Admin -> Posts(or post type) -> Categories (or taxonomy) to see Custom Category Image options. 2nd …depending on whether you want to show a single category image or display several in a loop – //SINGLE echo do_shortcode(‘[wp_custom_image_category onlysrc=”https://wordpress.org/plugins/wpcustom-category-image/false” size=”full” … Read more

Setting specific image size for specific form upload file field

Here’s an example of how to unset the standard WordPress sizes or any size for that matter assuming you know the image size name and of course you can simply inpect the $sizes array to determine what to unset… function wpse219360_disable_intermediate_image_sizes($sizes) { if ( isset($_FILES[‘file_input_1’]) && $_FILES[‘file_input_1’][‘error’] != UPLOAD_ERR_NO_FILE ) { unset($sizes[‘thumbnail’]); unset($sizes[‘medium’]); unset($sizes[‘large’]); } … Read more

How to set a Minimum Image Dimension for Uploading

The $file array doesn’t have anything that you’d be able to use, but $GLOBALS has some helpful information. You can uncomment the debugging line that contains $GLOBALS to see what it contains. I have added a guard clause to the top of the tc_handle_upload_prefilter function. This ensures that the file size checking code is only … Read more

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