Title: Parse error: syntax error, unexpected T_ENDWHILE
Last modified: August 20, 2016

---

# Parse error: syntax error, unexpected T_ENDWHILE

 *  Resolved [browneandrae](https://wordpress.org/support/users/browneandrae/)
 * (@browneandrae)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_endwhile-6/)
 * I am getting the follow error
 * Parse error: syntax error, unexpected T_ENDWHILE in /home/content/88/9177388/
   html/recover_pages/wp-content/themes/news/single-exhibitions_forms.php on line
   10
 * when trying to output my custom post type with custom fields, using the advanced
   custom fields plugin. I am using Genesis News Theme
 * Here is my code
 * <?php
    remove_action(‘genesis_loop’, ‘genesis_do_loop’); add_action(‘genesis_loop’,‘
   exhibitions_forms_loop’); function exhibitions_forms_loop() {
 *  $loop = new WP_Query( array( ‘post_type’ => ‘exhibitions_forms’, ‘posts_per_page’
   => 20 ) ); ?>
    } <?php the_field(‘description_of_business_activity’); ?> <?php
   the_field(‘company_name’); ?>
 * <?php endwhile;?>
    <?php
 * genesis();
 * What am I doing wrong

Viewing 1 replies (of 1 total)

 *  Thread Starter [browneandrae](https://wordpress.org/support/users/browneandrae/)
 * (@browneandrae)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_endwhile-6/#post-2924660)
 * Figured out I was missing a while.
 * Thank you

Viewing 1 replies (of 1 total)

The topic ‘Parse error: syntax error, unexpected T_ENDWHILE’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [endwhile](https://wordpress.org/support/topic-tag/endwhile/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * 1 reply
 * 1 participant
 * Last reply from: [browneandrae](https://wordpress.org/support/users/browneandrae/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_endwhile-6/#post-2924660)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
