• Resolved johnsalomon

    (@johnsalomon)


    Hi guys

    I am trying to get the PHP code widget to do something very simple – echo the value of a custom field on a per-post basis.

    In post #553, I’ve defined custom field “foobarbaz” with value “garply“.

    In my PHP code widget, I have:

    <?php echo get_post_meta($post->ID, ‘foobarbaz’, true); ?>

    …nothing.

    I’ve also tried (the post ID is 553)

    <?php echo get_post_meta(‘553’, ‘foobarbaz’, true); ?>

    That works. Is there any way I can figure out why it’s not picking up the post number?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with post_ID’ is closed to new replies.