Title: Custom fields
Last modified: August 19, 2016

---

# Custom fields

 *  Resolved [kreso777](https://wordpress.org/support/users/kreso777/)
 * (@kreso777)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-24/)
 * I have custom field value named “rating” which is a numerical value between 0–
   100.
    Is it possible to select and display, say, all the posts with numerical
   value larger than 80?

Viewing 1 replies (of 1 total)

 *  Thread Starter [kreso777](https://wordpress.org/support/users/kreso777/)
 * (@kreso777)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-24/#post-1601116)
 * Sorry for the ambiguous topic title, too late for changing.
 * Anyways, after 2 hours of testing and googling, finally managed to get it work.
   For the future reference, if anyone stumbles up here while googling here goes:
 *     ```
       <?php
       $myposts = get_posts('meta_key=CUSTOM_VALUE&meta_compare=>&meta_value=20&orderby=meta_value&ordrer=ASC');
       foreach($myposts as $post) :
           setup_postdata($post); ?>
       <li><a href="<?php the_permalink(); ?>"><?php the_title();?></a> <?php echo get_post_meta($post->ID, 'CUSTOM_VALUE', true); ?></li>
       <?php endforeach; ?>
       ```
   

Viewing 1 replies (of 1 total)

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

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [kreso777](https://wordpress.org/support/users/kreso777/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-24/#post-1601116)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
