Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Do you have an image selected for that post in the Featured Image metabox of the Edit Post screen? Here’s information on how to do it: http://en.support.wordpress.com/featured-images/#setting-a-featured-image

    But I don’t like how the plugin is currently putting an empty <a href=”… if there isn’t an image. I’ve just updated the plugin to only display the image code if an image size is specified AND the post has a thumbnail.

    Bill. Is there a way to display an image size in smaller size than thumbnail?

    Plugin Author Bill Erickson

    (@billerickson)

    I think you should be able to. In functions.php do something like:

    add_image_size( ‘be_small’, 100, 50, true );

    Then use ‘be_small’ as your image size.

    I haven’t tried it though.

    changyeon

    (@chang04wkuackr)

    hi Bill…
    I’m wordpress beginner and programming is poor and korean.
    I appreciate your effort…and I love your plugin “Display Posts Shortcode”
    I’d like to use attatched image(not featured image) as thumbnail image
    So I modified your code as bellow…

    my result site: http://chang04.wku.ac.kr
    source code : http://image.wku.ac.kr/2011/12/display-posts-shortcode-modified.php.txt

    ===============================
    original code: 124 line
    ===============================
    if ( $image_size && has_post_thumbnail() ) $image = ‘‘. get_the_post_thumbnail($post->ID, $image_size).’ ‘;

    ===============================
    modified code: 124 line
    ===============================
    $images = get_children( array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘numberposts’ => 999 ) );
    if ( $images ) { $total_images = count( $images );}
    $theImage = array_shift( $images );
    $image_img_tag = wp_get_attachment_image( $theImage->ID, ‘thumbnail’ );

    if ( $image_size && $image_img_tag ) $image = ‘<div class=”gallery-thumb”>‘. $image_img_tag.’</div> ‘;

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Display Posts Shortcode] Unable to see thumbnail even image tag is missing, plz help!’ is closed to new replies.