I need to modify this code to show get custom fields just for the post on which the user currently is.
// this needs to be modified
<?php
global $post;
$args = array('category' => 37, 'post_type' => 'post' );
$postslist = get_posts( $args );
foreach ($postslist as $post) : setup_postdata($post);
?>
// end this needs to be modified
<?php if( get_post_meta($post->ID, "Title", true) ): ?>
<?php echo get_post_meta($post->ID, "Title", true); ?></p>
<?php endif; ?>
Because this will be included, I cannot make it just with get_post_meta.
Many thanks!
This ignores the loop and only shows the custom field for the current page, notice get_the_ID():
And this will output all custom fields named “Title” from within the loop: