Show posts from WP Custom Post Type selected from a field in a metabox
This issue has been solved by changing the code that displays posts a little. <?php $albumsongs = get_posts( array(‘post_type’ => ‘song’, ‘numberposts’ => -1, ‘meta_key’ => ‘select_song_album’, ‘meta_value’ => get_the_ID(),) ); foreach( $albumsongs as $post ){ setup_postdata($post); ?> <div> <span><?php the_title(); ?></span> <span><a href=”https://wordpress.stackexchange.com/questions/352340/<?php the_permalink(); ?>”>View</a></span> </div> <?php } wp_reset_postdata(); ?>