Timeline for Image not showing using a custom function and get_post_meta
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 19, 2013 at 4:36 | vote | accept | Jerry R. | ||
Aug 11, 2013 at 5:07 | answer | added | Jerry R. | timeline score: 1 | |
Aug 11, 2013 at 5:03 | history | edited | Jerry R. | CC BY-SA 3.0 |
added 814 characters in body
|
Aug 11, 2013 at 4:45 | comment | added | Jerry R. |
@JohannesPille - I got it to work with empty instead of isset . @s_ha_dum - I will do some more research and updat the code to what you've recommended.
|
|
Aug 11, 2013 at 3:42 | comment | added | s_ha_dum |
No. Just define the function like function el_display($post){...} and supply a post object when using the function.
|
|
Aug 11, 2013 at 3:25 | comment | added | Jerry R. | @s_ha_dum - Sorry but I'm not sure I understand (sorry noob question). Do you mean to run a new WP query in the function? | |
Aug 11, 2013 at 3:19 | comment | added | Jerry R. | @CharlesClarkson - I just checked the source and an image tag is set however there is no source attribute or valid image path. I checked the database and the image path is there but not displaying in the source. | |
Aug 11, 2013 at 0:11 | comment | added | Johannes Pille |
I second the above. Also, you will want to use empty rather than isset in the conditional.
|
|
Aug 10, 2013 at 23:18 | comment | added | s_ha_dum |
Relying on global $post is a bit risky in my opinion. (I'd pass the $post data into the function explicitly.) Is that variable set correctly?
|
|
Aug 10, 2013 at 23:07 | comment | added | Charles Clarkson |
Check the page source to see if an <img> tag is sent to the browser. Then check to see if the src attribute is set to a valid image path.
|
|
Aug 10, 2013 at 22:47 | history | asked | Jerry R. | CC BY-SA 3.0 |