Title: reverse if(!empty($customField))
Last modified: August 20, 2016

---

# reverse if(!empty($customField))

 *  Resolved [broadleon](https://wordpress.org/support/users/broadleon/)
 * (@broadleon)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/reverse-ifemptycustomfield/)
 * How would you reverse this? so if the custom field is empty show posts
 *     ```
       <?php
   
                  $newquery = new WP_Query();  
   
                  $newquery->query('post_type=log');  
   
                  while($newquery->have_posts()) : $newquery->the_post();  
   
       		   $customField = get_post_custom_values('complete');
   
       		   if(!empty($customField)) {
   
                 ?>
       ```
   

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 2 months ago](https://wordpress.org/support/topic/reverse-ifemptycustomfield/#post-3594781)
 *     ```
       if(empty($customField)) {
       ```
   
 *  Thread Starter [broadleon](https://wordpress.org/support/users/broadleon/)
 * (@broadleon)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/reverse-ifemptycustomfield/#post-3594782)
 * cheers for that
    often its thats simple you can overlook it!

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

The topic ‘reverse if(!empty($customField))’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [broadleon](https://wordpress.org/support/users/broadleon/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/reverse-ifemptycustomfield/#post-3594782)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
