wp_get_attachment_image_src always returns full-sized image
I think this code will help you: $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’, false, ” ); echo ‘<img src=”‘.$src[0].'”>’;
I think this code will help you: $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’, false, ” ); echo ‘<img src=”‘.$src[0].'”>’;
Research The question Filter For Featured Image lead to this answer: How to hook update_post_meta and delete_post_meta?. Coupled with the a fine global variable ($_wp_additional_image_sizes) revealed here: How to get a list of all the possible thumbnail sizes set within a theme, bring us to the code that catches the “Use as featured image” action … Read more
Gee, I keep solving my own problems all the time. Here’s how I solved it in the end. I discovered that add_image_size does not ignore the identical dimensions of the image size, but instead points the file name towards the same file in the uploads dir. Once I knew that, I could just save the … Read more
You may want to look at the plugin Regenerate Thumbnails by Viper007Bond. Basically, this is how to do it: function regenerateThumbnails() { $images = $wpdb->get_results( “SELECT ID FROM $wpdb->posts WHERE post_type=”attachment” AND post_mime_type LIKE ‘image/%'” ); foreach ( $images as $image ) { $id = $image->ID; $fullsizepath = get_attached_file( $id ); if ( false === … Read more
A lot of the time the reason it isn’t working because you haven’t regenerated the thumbnails for all your images. If you have changed the dimensions of your images you will need to regenerate your thumbnails using this plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/
if you are referring to the ‘page for posts’, then try (only relevant section of your code shown): if (is_home() && get_option(‘page_for_posts’) ) { $img = wp_get_attachment_image_src(get_post_thumbnail_id(get_option(‘page_for_posts’)),’full’); $featured_image = $img[0]; } else {
$Featured_image = $wpdb->get_results(” SELECT p.* FROM net_5_postmeta AS pm INNER JOIN net_5_posts AS p ON pm.meta_value=p.ID WHERE pm.post_id = $da_id AND pm.meta_key = ‘_thumbnail_id’ ORDER BY p.post_date DESC LIMIT 15 “,’ARRAY_A’);
It is necessary to set an alt value for all of your images, in case a browser can not load the image or the visitor is using screen reader. You have two options. Either use the featured image’s caption (which can some times be blank) or use the post’s title as alt. You can get … Read more
Seems that the answer is no… I’ve followed the core functions and found a dead-end. And found this post ( How can I make add_image_size() crop from the top? ) where Rarst says: Intermediate image generation is extremely rigid. Image_resize() keeps it close to code and completely lacks hooks. But, following the lead of the … Read more
There’s not enough info to be sure this answer is definitive but here’s an attempt. Firstly make sure the image you are uploading is actually larger than the size you have defined. I see people upload images that are too small and then get this sort of result all the time. Secondly, WP will only … Read more