Custom Fields
-
I have numerous custom fields working on different pages of my blog, but for some reason on one page they just won’t work!
All I am trying to do is display an image using the following code:
<img src="<?php $key="thumbnail"; echo get_post_meta($post->ID, $key, true); ?>" width="250" height="120" alt="thumb"/>
And a backgroud image using:
<div id="portfolio-feature" style="background:#000 url(<?php $key="background"; echo get_post_meta($post->ID, $key, true); ?>) center center;"></div>
They are both within the loop and if I use <?php the_meta(); ?> I can see that the key values are returned fine, but for some reason they just don’t work in the img src
Would be most grateful for any help!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Custom Fields’ is closed to new replies.