WordPress.org

Support

Support » Plugins and Hacks » Hacks » Missing an image in my custon code

Missing an image in my custon code

Viewing 3 replies - 1 through 3 (of 3 total)
  • Also, sorry for the way that formatted – I don’t usually post code, anywhere.

    Gary

    Okay… further investigation shows that the functions works fine – it just won’t work if you include the shortcode more than once in the same page.

    If postA has no thumbnail but postB does, then two blanks are produced.

    If PostA has a thumbnail but postB doesn’t, then a thumbnail is produced for postA and no tag/result at all for postB.

    The value of has_post_thumbnail() is persisting across iterations of the shortcode, so is there something that resets all the values, or something like %posts -> post_thumbnail ?

    Gary

    Ha! Fixed!

    Used get_the_post_thumbnail($pid) instead.

    Gary

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Missing an image in my custon code’ is closed to new replies.