Why html tags are being appended to my pictures?

Sometimes, WordPress likes wrapping <img … tags with extra HTML. You could try something like as listed on http://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/. In your theme’s functions.php file, add the following lines of code near the top: function filter_ptags_on_images($content){ return preg_replace(‘/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU’, ‘\1\2\3’, $content); } add_filter(‘the_content’, ‘filter_ptags_on_images’);

How to get image extension from wp image editor object?

I tried using generate_filename yesterday but probably it was kind of late and I was trying and didnt manage to make it work, today I managed to workaround the problem without fetching the image another time like this: $save_path = WP_CONTENT_DIR . ‘/tmp/’ . $img_name . “-” . $nw . “x” . $nh; $wp_img->save($save_path); $img_name … Read more

Broken urls with http site and https wp-admin

My advice is to make the whole site https. Either add https to the settings -> wordpress address & settings -> site address or remove https if it appears in either of those inputs. For securing admin login panel only: easy method but doesn’t show secure icon. right result but more steps to consider method.

Different upload path per file type

Change upload directory for PDF Files seems to be a good stepping stone forward. Although untested, looking at the code my adaptation would be along the lines of… <?php add_filter(‘wp_handle_upload_prefilter’, ‘custom_media_library_pre_upload’); add_filter(‘wp_handle_upload’, ‘custom_media_library_post_upload’); function custom_media_library_pre_upload($file){ add_filter(‘upload_dir’, ‘custom_media_library_custom_upload_dir’); return $file; } function custom_media_library_post_upload($fileinfo){ remove_filter(‘upload_dir’, ‘custom_media_library_custom_upload_dir’); return $fileinfo; } function custom_media_library_custom_upload_dir($path){ $extension = substr(strrchr($_POST[‘name’],’.’),1); if ( !empty( … Read more