php - Why isn't get_post_meta working? -
simple wordpress problem - get_post_meta not retrieving custom field values. here's code pulling custom fields:
<img src="<?php echo fcg_plugin_url; ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->id, 'slider_image', true); ?>&h=250&w=400&zc=1" alt="<?php echo $post_title; ?>" />
in production, html get:
<img alt="post title" src="http://***.com/wp-content/plugins/jquery-slider-for-featured-content/scripts/timthumb.php?src=/&h=50&w=80&zc=1">
you can see src= point in string empty - if there nothing posting it. have isolated , echo'd get_post_meta , it's whitespace. 100% sure it's named correctly within post - there glaring i'm missing here?
search term "slider_image" in wp_posts , wp_postmeta tables using phpmyadmin. view row has see if there's inside.
also try changing name of custom value test , see if works. use exact code similar , works:
<p><a href="<?php echo get_post_meta($post->id, 'resume', true) ?>"><img src="<? bloginfo('template_url'); ?>/img/downloadresume.png"></a></p>
Comments
Post a Comment