Set Post Thumbnails in Percents

This is not possible, images must have real absolute sizes 🙂 A post thumbnail is essentially a different sized version of the image. While you can calculate how much for example 70% of 1024 is, and genereate a ~700px wide image, you cannot do this for each of your visitors. It would kill your host’s … Read more

Show last 2 image attachments from posts

function show_all_thumbs() { global $post; $post = get_post( $post ); /* image code */ $images = & get_children( ‘post_type=attachment&post_mime_type=image&output=ARRAY_N&orderby=menu_order&order=ASC&post_parent=” . $post->post_parent ); if( $images ) { $i = 0; $images = array_reverse( $images ); foreach( $images as $imageID => $imagePost ) { unset( $the_b_img ); $the_b_img = wp_get_attachment_image( $imageID, “thumbnail’, false ); $thumblist .= ‘<a … Read more

oEmbed, thumbnails and wordpress

Use the oembed_dataparse filter to modify the resulting HTML output by any given oembed call. Example: add_filter(‘oembed_dataparse’,’test’,10,3); function test($return, $data, $url) { if ($data->provider_name == ‘YouTube’) { return “<img src=”https://wordpress.stackexchange.com/questions/79894/{$data->thumbnail_url}”>”; } else return $return; } Then putting this in a post: Will give you a picture of Rick Astley instead of a flash video of … Read more

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