Support » Fixing WordPress » Single Value from Custom Field

  • Resolved Majestix


    Hi there,

    I’m using the coffee mod for the custom field but maybe this works with WordPress itself, too.

    This is pulling the Data as wanted with the plugin:
    <?php echo c2c_get_custom('Quelle', '| <span class="quelle"><a href="', '" target="_blank" rel="nofollow">Via</a></span>'); ?>

    I thought I can do the same with this:
    <? get_post_meta(the_ID(), "Quelle", $single = true); ?>
    But it actually doesn’t work, I just get the postID. Is it possible to get a single custom field value with WordPress itself?


Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s the_ID() you can’t use that–that template tag just echo the ID of the ‘current’ post.

    Try this instead:
    <?php echo 'my meta ' . get_post_meta($post->ID, 'Quelle', 1); ?>

    Perfect, that works! Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Single Value from Custom Field’ is closed to new replies.