Conditional Thumbnail Display? Check for thumbnail, if not, display code
-
So I’ve got a weird idea.
I want wordpress to check to see if a post has a thumbnail / featured image. If it does, I want it to display the image, either in thumb size or one of the other featured image sizes depending on how I call it.
but if there isn’t one, I want wordpress to excecute different code. In this case I want it to use an isbn number gotten from a custom field to grab an image from amazon.
That code I’ve got:
<?php echo c2c_get_custom('isbn-10', '<img src="https://images.amazon.com/images/P/','.01.LZZZZZZZ.jpg" alt="Book Cover" /></a>'); ?>
Though I’d like to replace “Book Cover” with the title, but wasn’t sure if I could put php inside that other php. I’m still not clear on the formatting.
Anyone know how I might do this?
- The topic ‘Conditional Thumbnail Display? Check for thumbnail, if not, display code’ is closed to new replies.