Title: Custom fields
Last modified: August 20, 2016

---

# Custom fields

 *  [designnz](https://wordpress.org/support/users/designnz/)
 * (@designnz)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-fields-70/)
 * I have a custom field called “condition” with two options “new” and “used”,
 * Now i want to be able to call an if statement where when either of the two above
   options are selected an echoed style is outputted?
 * Anyone have any ideas?
 * Thanks in advanced

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-fields-70/#post-3533286)
 * example:
 *     ```
       <?php if( get_post_meta( $post->ID, 'condition', true ) == 'new' ) { ?>
       echo your style for new
       <?php } elseif( get_post_meta( $post->ID, 'condition', true ) == 'used' ) { ?>
       echo your style for used
       <?php } ?>
       ```
   

Viewing 1 replies (of 1 total)

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

## Tags

 * [custom field](https://wordpress.org/support/topic-tag/custom-field/)
 * [custom posts](https://wordpress.org/support/topic-tag/custom-posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/custom-fields-70/#post-3533286)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
