Hy I have this code:
<?php
$id_film_array = get_post_meta(get_the_ID(),"info_film", true);
$id_film = $id_film_array[0];
$titlu_film = get_the_title($id_film);
?>
<?php
$the_query = new WP_Query( array( 'p' => $id_film) );
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<a href="<?php echo get_permalink($id_film); ?>"><?php echo $titlu_film; ?></a>
<?php
endwhile;
// Reset Post Data
wp_reset_postdata();
?>
I recive an error if i do not have anithing select. How can i fix this.
For example i do not want to select nothing for some post, in the page i do not want to retrive nothing.
I use Custom Field, Relationship