imported post image as normal image instead encoded image

after several experiment to reproduce the problem under various circumtances, i found that the post’s image somehow already encoded in the first place, so this is not wordpress importer problem. for someone who might be experienced the same thing, could read this clue : https://stackoverflow.com/questions/19623011/wordpress-avoid-using-data-uri-scheme

get_the_post_thumbnail() title and alt attributes not displaying

Turns out this was caused by the following custom theme filter in functions.php. Commenting out fixed the problem. function image_alt_tags($content) { global $post; preg_match_all(‘/<img (.*?)\/>/’, $content, $images); if (!is_null($images)) { foreach($images[1] as $index => $value) { if (!preg_match(‘/alt=/’, $value)) { $new_img = str_replace(‘<img’, ‘<img alt=”‘ . get_the_title() . ‘”‘, $images[0][$index]); $content = str_replace($images[0][$index], $new_img, $content); … Read more

How can I insert and display copyright owner field on featured-images, pictures and galleries in articles?

Try this: /** * Adding a “Copyright” field to the media uploader $form_fields array * * @param array $form_fields * @param object $post * * @return array */ function add_copyright_field_to_media_uploader( $form_fields, $post ) { $form_fields[‘copyright_field’] = array( ‘label’ => __(‘Copyright’), ‘value’ => get_post_meta( $post->ID, ‘_custom_copyright’, true ), ‘helps’ => ‘Set a copyright credit for the … Read more