• Resolved designblogg

    (@designblogg)


    Hi

    I am modifying this plugin to output results “correctly” for my site.
    Most of it is working like a charm, only the thumbnail is giving me issues.

    if ( $image_size && has_post_thumbnail() ) $image = '<a class="contentrotator-thumb" href="'. get_permalink() .'">'. get_the_post_thumbnail($post->ID, $image_size).'</a> ';

    I am trying to create this as a normal IMG SRC, not a link, but then it all just falls down like a house of cards.

    code I an trying to use is

    if ( $image_size && has_post_thumbnail() ) $image = '<img class="contentrotator-thumb" src="'. get_the_post_thumbnail().'" />';

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter designblogg

    (@designblogg)

    I have btw also tried it with the following without any luck

    if ( $image_size && has_post_thumbnail() ) $image = '<img class="contentrotator-thumb" src="'. get_the_post_thumbnail($post->ID, $image_size).'">''</img> ';

    Thread Starter designblogg

    (@designblogg)

    Looking over the source from FF, I see the get_the_post_thumbnail argument creates an IMG SCR output automatically, question then is, where do I edit the output of this?

    Thread Starter designblogg

    (@designblogg)

    figured out a solution by editing the image output in href rather than removing the href alltogether

    If you want the image URL without the full image tag, do something like this:

    $image_array = wp_get_attachment_image_src( get_post_thumbnail_id(), $image_size );
    $image = ‘<img src=”‘ . $image_array[0] . ‘” />’;

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Display Posts Shortcode] Hacking the thumbnail output’ is closed to new replies.