Integrate video and iframe in a post type gallery

The problem is that image is not a proper mime type. You can see a list of mime-types here – so based off the linked list we need to pass an array of what we need: $supported_mimes = array( ‘image/jpeg’, ‘image/gif’, ‘image/png’, ‘video/avi’, ‘video/x-flv’, ‘video/mp4’, ‘video/ogg’, ‘video/webm’, ); $args = array( ‘numberposts’ => -1, // … Read more

Image linking and lightbox

So, the problem is that on Expositio theme they are adding some jQuery code to all links, that if you’re not closing the mobile menu, after a configurable number of seconds (1 second by default) just redirect site to the link url. If you go to line 260 of js/functions.js you find this: $(‘a’).on(‘click’, function(e) … Read more

Adding a URL Parameter to JPEG images in posts

function add_jpeg_params($content){ preg_match_all(“/https?:\/\/[^\/\s]+\/\S+\.(jpg|jpeg)/”, $content, $output_array); $items_to_replace = array_unique($output_array[0]); $items_to_replace = array_values($items_to_replace); for ($j = 0; $j < sizeof($items_to_replace); $j++) { $content = str_replace($items_to_replace[$j], $items_to_replace[$j] . ‘?t=” . time(), $content); } return $content; } add_filter(“the_content’,’add_jpeg_params’,10); add_filter(‘post_thumbnail_html’, ‘add_jpeg_params’ );

Image Uploader Doesn’t Open Modal in Widget

After many hours of testing and exploring I finally found what causing the problem. If I add class to the button it’s working. But not any class, only class deo-btn. So, this will work: <input type=”button” id=”image-upload-button” class=”deo-btn button button-primary” value=”Add Image”> And this is not: <input type=”button” id=”image-upload-button” class=”button button-primary” value=”Add Image”> Also, this … Read more

How to make an image appear as a thumbnail in the blog post?

That’s because you’re using an small image to display in that container, the containers has 1100×300 pixels and you’re using a imagem with 560×315 pixels, so when you resize it lost quality. When working with imagem I recommend you to get a image with at least the same sizes of the maximum sizes that you … Read more

restrict uploaded image size and fixed image display size

Add this code to your theme’s functions.php file, and it will limit image dimentions add_filter(‘wp_handle_upload_prefilter’,’tc_handle_upload_prefilter’); function tc_handle_upload_prefilter($file) { $img=getimagesize($file[‘tmp_name’]); $minimum = array(‘width’ => ‘600’, ‘height’ => ‘900’); $width= $img[0]; $height =$img[1]; if ($width < $minimum[‘width’] ) return array(“error”=>”Image dimensions are too small. Minimum width is {$minimum[‘width’]}px. Uploaded image width is $width px”); elseif ($height < … Read more

Image automatically resized

The ‘?w=640’ on the end of the image file is not a bad thing, it just tells the browser what size to display. If you want to modify the size of the image try these methods: (1) The simplest method is to edit the image on the page. When you’re in the Visual Editor of … Read more

WooCommerce Variation Swatches and Photos – get attribute thumbnail

I resolved it by using get_woocommerce_term_meta $terms = get_terms( array( ‘taxonomy’ => ‘pa_texture’, ‘hide_empty’ => false, )); foreach ( $terms as $term ) : $thumbnail_id = get_woocommerce_term_meta( $term->term_id, ‘pa_texture_swatches_id_photo’, true ); $textureImg = wp_get_attachment_image_src( $thumbnail_id, ‘full’ ); ?> <img src=”https://wordpress.stackexchange.com/questions/274247/<?php echo $textureImg[0]; ?>”> endforeach;