WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Can't retrieve custom field data with next post link

[Resolved] Can't retrieve custom field data with next post link

Viewing 6 replies - 1 through 6 (of 6 total)
  • dfunkydog

    @dfunkydog

    Didn’t check the logic but surely this line has syntax errors

    else {
    	echo '<img width="200" src="<?php echo get_post_meta($nextPost->ID, 'label_value', true); ?>"/>';
    }
    Waqas

    @muhammadwaqas

    I tried this, but no result

    echo '<img width="200" src="'.get_post_meta($nextPost->ID,'label_value',ture).'_250.jpg"/>';

    Michael

    @alchymyth

    echo '<img width="200" src="<?php echo get_post_meta($post->ID, 'label_value', true); ?>"/>';
    Waqas

    @muhammadwaqas

    this code is working. I just remove the “next” from post id.

    alchymyth code seems correct too but it doesn’t work that way. But I’ve got the idea that I was wrong about $nextPost->ID

    echo ‘<img src=”‘.get_post_meta($post->ID,’label_value’,ture).'”/>’;

    Thanks all.

    Michael

    @alchymyth

    well spotted ๐Ÿ˜‰

    – I missed that because I just focussed on the $post_ID and your queston did not mention any syntax errors.

    if this is all, please mark the topic as ‘resolved’ – dropdown at the right or tick box near the bottom.

    Waqas

    @muhammadwaqas

    yeah, thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Can't retrieve custom field data with next post link’ is closed to new replies.
Skip to toolbar