• Resolved moongoose

    (@moongoose)


    Hi,

    I can insert the following code in my sidebar.php file:

    <?php $sidebar = get_post_meta($post->ID, 'Sidebar', $single = true); ?>
    <?php if($sidebar !== '') { ?>
    <?php echo $sidebar; ?>
    <?php } else { echo ''; } ?>

    And the values in my Sidebar custom field display. But when I insert this code into the PHP widget instead, it simply does not get the post meta data. Any ideas what I’m doing wrong?

    http://wordpress.org/extend/plugins/php-code-widget/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘[Plugin: PHP Code Widget] get post meta data not working in PHP Widget’ is closed to new replies.