Add class name to post thumbnail

Yep – you can pass the class you want to use to the_post_thumbnail() as part of the attributes argument, for example <?php the_post_thumbnail(‘thumbnail’, array(‘class’ => ‘your-class-name’)); ?> Ref: http://codex.wordpress.org/Function_Reference/the_post_thumbnail#Styling_Post_Thumbnails

How to Fix HTTP Error When Uploading Images?

I put the following code into my functions.php file. It works! add_filter( ‘wp_image_editors’, ‘change_graphic_lib’ ); function change_graphic_lib($array) { return array( ‘WP_Image_Editor_GD’, ‘WP_Image_Editor_Imagick’ ); } When this helps it is because it changes the PHP code module used for processing the uploaded image for use with WordPress. This processing includes moving the image into the media … Read more

How do I get image url only on the_post_thumbnail

You might also try: If you only have one size thumbnail: $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) ); Or…if you have multiple sizes: $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), “size” ); Note that wp_get_attachment_image_src() returns an array: url, width, height, is_intermediate. So if you just want only the image url: echo $thumbnail[0]; Resources: http://wpcanyon.com/tipsandtricks/get-the-src-attribute-from-wordpress-post-thumbnail/ https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/

Filter to remove image dimension attributes?

Thanks all! The image_send_to_editor filter was the one I was looking for… thanks @t31os for pointing it out. Here’s my functions now. add_filter( ‘post_thumbnail_html’, ‘remove_thumbnail_dimensions’, 10 ); add_filter( ‘image_send_to_editor’, ‘remove_thumbnail_dimensions’, 10 ); function remove_thumbnail_dimensions( $html ) { $html = preg_replace( ‘/(width|height)=\”\d*\”\s/’, “”, $html ); return $html; } This removes inline dimension attributes from images retrieved … Read more