How to add image id class?

Shamelessly copied from here: https://letswp.io/add-attachment-id-to-the-class-of-wordpress-images/ add_filter( ‘wp_get_attachment_image_attributes’, ‘add_image_id_class’, 10, 2 ); function add_image_id_class( $attr, $attachment ) { $class_attr = isset( $attr[‘class’] ) ? $attr[‘class’] : ”; $has_class = preg_match( ‘/wpimage\_[0-9]+/’, $class_attr, $matches ); if ( !$has_class ) { $class_attr .= sprintf( ‘ wpimage_%d’, $attachment->ID ); $attr[‘class’] = ltrim( $class_attr ); } return $attr; } This … Read more

Restrict Image Uploads to a Certain File Type

First off, PNGs do not necessarily slow your site down anymore than a JPG. It all depends on how the image is saved or optimized and the file size. Anyway. You have a couple options. Since this site is about coding and we don’t support 3rd party plugins I will give you this first. You … Read more

Add instructions to featured image

WordPress has a hook for that. Here is a sample code: function featured_image_dimensions( $content, $post_id, $thumbnail_id ){ $help_text=”<p>” . __( ‘recommended dimensions – H980px by W450px’, ‘my_domain’ ) . ‘</p>’; return $help_text . $content; } add_filter( ‘admin_post_thumbnail_html’, ‘featured_image_dimensions’, 10, 3 ); Add this code to your functions.php and you should be good to go.

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