Wordpress & PHP to check if custom field exists, and if not replace with a random string -


I am trying to create a function that checks the existence of post_thumbnail () It sets up the background image of a post and an element in Wordpress Here's what I've tried here:

   

It currently crashes / I have been confused about when and where to use quotation marks while using PHP in HTML markup!

Any ideas how can I do this?

Words do bloginfo;

  & lt ;? Php if (has_post_thumbnail)) {The_post_thumbnail ( 'full');} else {echo get_bloginfo ( 'stylesheet directory "). '/assets/img/article-overlay-1.jpg';}? & Gt;  

Cheers!


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -