Resize uploaded original images to a minimum automatically

From purely WordPress point of view you want add_image_size() with a “hard” crop mode. That will ensure that any significantly large image will be sized to fit into those dimensions exactly, cropping some parts if necessary. The problem is usually that WP won’t upsize small images to fit, as far as I remember. It is … Read more

How can I make an image full width inside a paragraph which is 70% (text) [closed]

Solved, JS with jQuery width(), removeAttr() to avoid wordpress inline width and height. Also negative margins. var anchoArticulo = $(‘article.single-post’).width(); $(‘article.single-post div.single-post img.ancho_completo’) .removeAttr(‘width height’) .css(‘margin-left’ , -(winWidth – anchoArticulo)/2) .css(‘width’ , winWidth); Class ancho_completo is added in dashboard to the image.

Force default OG:Image – Yoast SEO [closed]

The action that allows an OG image to be added seemed to be the thing I was looking for, so much for proper documentation on their side. But now the only thing I’m wondering if the following code I made up is the proper way to deal with it: $default_opengraph=”https://www.rafaeldejongh.com/wp-content/uploads/2017/08/RafaelDeJongh-Web-Developer-3D-Artist.jpg”; function add_default_opengraph($object){global $default_opengraph; $object->add_image($default_opengraph);} add_action(‘wpseo_add_opengraph_images’,’add_default_opengraph’); … Read more

using wp_get_attachment_image_src in foreach loop

First in your first loop why do you break it? if there is no image in image_5 if someone just skip this and continue to image_6? Second the ACF image field can return you an array with all the sizes. you need to set the field to return you Image Array And then you can … Read more

How to Add Shortcode to html img code?

You cannot use Shortcodes in attributes since 4.2.3, for security reasons. See the announcement (emphasis mine): Earlier today, we released WordPress 4.2.3, which includes a relatively large security fix that affects the Shortcode API. Due to the nature of the fix – as is often the case with security fixes – we were unable to … Read more

How to display post title inside thumbnail?

Think this should do it… (there are hundreds of ways to achieve this) <?php // Display blog posts on any page @ https://m0n.co/l $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query(‘posts_per_page=5’ . ‘&paged=’.$paged); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail … Read more