Title: Custom Fields
Last modified: August 19, 2016

---

# Custom Fields

 *  [Ashkir](https://wordpress.org/support/users/ashkir/)
 * (@ashkir)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/custom-fields-22/)
 * How do I use custom fields currectly?
 * I’m using this now:
 *     ```
       <?php $flickr = get_post_meta($post->ID, 'flickr', true); ?>
       <?php $exif = get_post_meta($post->ID, 'exif', true); ?>
       <a href="<?php echo $flickr; ?>">View Flickr Page</a> | <a href="<?php echo $exif; ?>">View EXIF Data</a><br />
       ```
   
 * How can I get the two links to only show if the custom field is filled in?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [dralezero](https://wordpress.org/support/users/dralezero/)
 * (@dralezero)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/custom-fields-22/#post-1483155)
 * This will only show each one that is filled in. It will show the separator only
   if both are there. I didn’t test this actual code but this is how I do stuff 
   like this.
 *     ```
       <?php $flickr = get_post_meta($post->ID, 'flickr', true); ?>
       <?php $exif = get_post_meta($post->ID, 'exif', true); ?>
   
       <?php if($flickr !=""){?>
       <a href="<?php echo $flickr; ?>">View Flickr Page</a>
       <?php } ?>
       <?php if($flickr !="" && $exif !=""){?>|<?php } ?>
       <?php if($exif !=""){?>
       <a href="<?php echo $exif; ?>">View EXIF Data</a>
       <?php } ?>
       <br />
       ```
   
 *  Thread Starter [Ashkir](https://wordpress.org/support/users/ashkir/)
 * (@ashkir)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/custom-fields-22/#post-1483210)
 * Thank you dralezero! It worked! :]

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Fields’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Ashkir](https://wordpress.org/support/users/ashkir/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/custom-fields-22/#post-1483210)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
