Change code to display image attachment page

As pointed in the other answer, you should not have prettyPhoto part The link should be changed to utilize the function get_attachment_link Basically change this line in your code $link = ‘<a href=”‘.get_attachment_link($id).'”>’.wp_get_attachment_image($id, $size, false).'</a>’;

Rename attachments during upload no matter what filetype

Simply decide this on what data you got for your file (I use $file instead of $arr as argument, as it’s easier to understand later). if ( ‘image’ == array_shift( explode( “https://wordpress.stackexchange.com/”, $file[‘type’] ) ) ) // do wonderful things You can always simply look into what you got with adding the following line to … Read more

Edit default image attachment size

you can try this function filter_ptags_on_images($content) { $content = preg_replace(‘/\s*()?\s*()\s*()?\s*/iU’, ‘\1\2\3’, $content); return preg_replace(‘/\s*(*.)\s*/iU’, ‘\1’, $content); } add_filter(‘the_content’, ‘filter_ptags_on_images’); this also has been solved here remove p tags from images

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