Title: WordPress Loop/Query is crashing
Last modified: August 22, 2016

---

# WordPress Loop/Query is crashing

 *  [Levothyroxin](https://wordpress.org/support/users/levothyroxin/)
 * (@levothyroxin)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-loopquery-is-crashing/)
 * Hello.
    I am developing a custom theme and the problem is the following. I have
   two Custom Post Types created with Custom Post Types UI plugin. Each type has
   Advanced Custom Fields assocciated with it.
 * When I now want to query these post types with the following code, the site just
   keeps loading and I get an fatal error from the max_execution_time.
 *     ```
       $qa = array("post_type"=>array("events","events_special"));
       $query = new WP_Query($qa);
       if( $query->have_posts() ){
        while($query->have_posts() ){
         the_post();
        }
       }
       ```
   
 * The site even brakes when I use the normal/standard loop.
    I tried to disable
   all plugins but the problem is still there. Can somone help me plz.

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

 *  [rikardo85](https://wordpress.org/support/users/rikardo85/)
 * (@rikardo85)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-loopquery-is-crashing/#post-5713957)
 * Try:
 * $qa = array( “post_type” => array(“events”,”events_special”) );
    $query = new
   WP_Query( $qa ); if( $query->have_posts() ) { while( $query->have_posts() ) :
   $query->the_post(); // Code here endwhile; } wp_reset_query();
 *  Thread Starter [Levothyroxin](https://wordpress.org/support/users/levothyroxin/)
 * (@levothyroxin)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-loopquery-is-crashing/#post-5714064)
 * Still not working:
 *     ```
       Fatal error: Maximum execution time of 30 seconds exceeded in
       PATH\wp-includes\query.php on line 749
       ```
   
 *  [rikardo85](https://wordpress.org/support/users/rikardo85/)
 * (@rikardo85)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-loopquery-is-crashing/#post-5714071)
 * If you remove the code you’ve entered does it work or does the problem still 
   exist?
 *  Thread Starter [Levothyroxin](https://wordpress.org/support/users/levothyroxin/)
 * (@levothyroxin)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-loopquery-is-crashing/#post-5714072)
 * I found a solution.
    I deleted all custom post types an created new ones. Now
   it is working. Thank you for your help. The actual code is now:
 *     ```
       $qa = array(
           "post_type" => array( "event_standard", "event_special" )
           );
   
       $q = new WP_Query($qa);
   
       if( $q->have_posts() ){
   
           while( $q->have_posts()){
               $q->the_post();
               //more Code here
           } //END WHILE
   
       } //END IF
       ```
   

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

The topic ‘WordPress Loop/Query is crashing’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Levothyroxin](https://wordpress.org/support/users/levothyroxin/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-loopquery-is-crashing/#post-5714072)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
