If there is no value for a custom field "imageembed", how will I not show this code?
& lt ;? Php $ imageid = get_post_meta ($ post- & gt; ID, 'imageembed', true); ? & Gt; & Lt; Div class = "newsimage" & gt; & Lt; img src = "& lt ;? Php Echo wp_get_attachment_url ($ imageid) ;? & Gt;" Width = "640" /> gt; & Lt; / Div & gt;
something like
& lt; Php if (strangel ($ imageid = get_post_meta ($ post-> id, 'imageembed', is true))) {? & Gt; & Lt; Div class = "newsimage" & gt; & Lt; Img src = "& lt ;? php echo wp_get_attachment_url ((int) $ imageid) ;? & gt;" Width = "640" /> gt; & Lt; / Div & gt; & Lt ;? Php}? & Gt;
Comments
Post a Comment