Change image link in excerpt to point to post

Images are embedded in post content as pretty much straight HTML. <a href=”http://192.168.1.10/wp_release/wp-content/uploads/2011/01/boat.jpg”> <img src=”http://192.168.1.10/wp_release/wp-content/uploads/2011/01/boat.jpg?w=300″ alt=”” title=”boat” class=”size-medium wp-image-544″ height=”198″ width=”300″> </a> There is no easy way to alter that. You can alter it, but it means regexing the post body content or using an html parser like Simple HTML DOM Parser (Not an endorsement, … Read more

Media upload in add comment meta box

You could start with this : add_action( ‘comment_form_logged_in_after’, ‘wpse_102612_additional_fields’ );// only for logged users function wpse_102612_additional_fields () { echo ‘<p class=”comment-form-upload”>’. ‘<label for=”upload”>’ . __( ‘Upload your file’ ) . ‘</label>’. ‘<input id=”upload” name=”upload” type=”file” size=”30″ /></p>’; }

Import existing image as a single post

See my answer here: The Media Library lives in both wp_posts and wp_postmeta. wp_postmeta contains the image URL wp_posts contains an entry for each image insertion into a post, along with the post ID. Exporting and importing these 2 tables as SQL did not work for me – I received ‘duplicate entry for key 7’… … Read more