Link to larger thumbnail in custom query (with custom post-types)

In your code you are linking to an image using this code: wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), “medium” ); So what you are doing is showing the medium sized image as well as linking to the medium image. What you need to do is link to the full sized image: wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), “full” ); … Read more

Show post thumbnail only if it exists using timthumb

As commented above, you don’t have to use TimThumb at all to get additional image sizes for your uploaded images. WordPress ships with the add_image_size() function. // functions.php add_action(‘init’, ‘wpse26655_add_additional_image_sizes’); function wpse26655_add_additional_image_sizes() { add_image_size(‘thumb200x120’, 200, 120, true); } In your template files, you could than query your thumbnail with your desired image size. E.g. <?php … Read more

Source problem for children page image

Never mind about my question… here is your answer Put this function on your functions.php // Get Featured Image Path function get_featured_image_link($size){ global $post; $get_featured_image_link = get_the_post_thumbnail($post->ID, $size); preg_match(“/(?<=src=[‘|\”])[^’|\”]*?(?=[‘|\”])/i”, $get_featured_image_link, $thePath); return $get_featured_image_link_final = $thePath[0]; } Then this is the process to get the image… <?php $the_query = new WP_Query( array( ‘post_parent’ => ’20’, ‘post_type’ … Read more

Get all images from posts with maximum number and without featured image

Try this: $image_count = 0; $max_images = 10; //set this to the max number of images you want. $ids = get_posts( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1 ,’fields’ =>’ids’) ); if (count($ids) > 0){ foreach ($ids as $id){ while ($image_count < $max_images){ $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, … Read more