wordpress media library shows empty images

Plugins such as Search and Replace can help you to properly fix the URLs in your database. Likewise, consider using backup-and-migration plugins such as BackupBuddy (paid) or Duplicator (free) to properly and more easily move your site (while automatically handling the above search-and-replace operation).

How can I make all post image uploads have data-width and data-height attributes automatically by default?

Yes you can. See my working fiddle here: http://jsfiddle.net/MonkimoE/0wtgm8a1/ You need to add an id. example: <img class=”img” id=”imageid”….. Delete all atribute “data-width” and “data-height”. because it will added automatically. Add this javascript: (you may change the ‘$’ to ‘jQuery’ if doesn’t work with your theme) <script> var img = document.getElementById(‘imageid’); var width = img.naturalWidth; … Read more

Creating page templates with image placeholders

ACF, which you mentioned, would be the easiest/fastest way to get this done. A post by default has a single thumbnail, no magic option to add another with less work than what ACF does. If the design allows for it, you could also insert the second image straight into content and align it to the … Read more

Add “data-” attribute to image links

while googling about the same issue I came upon your question and a similar question from the WordPress forums. You can control the output of the generated code via the image_send_to_editor filter like this: function filter_image_send_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) { $html = sprintf(‘<a href=”#” data-rel=”lightbox-0″><img alt=”%2$s” src=”%1$s” /></a>’, esc_attr(esc_url($url)), esc_attr($title)); return … Read more

Is there a way to change wordpress image resize settings?

The file size increase you describe sounds odd. Are you referring to jpegs? Anyway, you can control loss quality for jpegs. Add this to your functions file: add_filter( ‘jpeg_quality’, create_function( ”, ‘return 80;’ ) ); Replacing 80 with whatever percentage you would prefer.

Lazyload post thumbnails

You got everything you need, simply build your own img-element like this: if ( has_post_thumbnail() ) { $class=”lazy attachment-thumbnail-400-300″; //Get thumbnail source $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘thumbnail-400-300’); $src = $thumb[‘0’]; $placeholder = “//placehold.it/400×300/eee/222/&text=+”; echo ‘<img src=”‘.$placeholder.'” data-original=”‘.$src.'” class=”‘.$class.'” />’; } Besides that, your main performance issue might be generating a new placeholder every time you want … Read more

Using Add_image_size when adding image in post

You also need to add it to image size chooser.You can do so using the filter image_size_names_choose. add_filter( ‘image_size_names_choose’, ‘wpse_228675_custom_size’ ); function wpse_228675_custom_size( $sizes ) { return array_merge( $sizes, array( ‘image_horizontal’ => __(‘Custom image size’), ) ); }

change the $content_width

Is there are better way to change this (annoying) variable please? The Twenty Sixteen theme provides you with the twentysixteen_content_width filter, where the default is 840. To modify it you should be able to use this within your child theme’s functions.php file: add_filter( ‘twentysixteen_content_width’, function( $content_width ) { // Override the default 840 content width … Read more

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