Add second id in post by costume field
-
Hello to everyone
Is it possible to define costume field as second id of post.
I want to echo fields of post not with id of a post, but with my cotume field id
This code take field with post id
<?php $id = 6501; $temp = $post; $post = get_post( $id ); setup_postdata( $post ); ?> <a href="<?php the_permalink() ?>" target="_blank"> <?php echo get_post_meta($post->ID, 'title', true); ?> <?php echo get_post_meta($post->ID, 'artist', true); ?> </a> <?php wp_reset_postdata(); $post = $temp; ?>
- The topic ‘Add second id in post by costume field’ is closed to new replies.