Support

Home Forums Event Espresso Premium Archive Listings page not working after upgrade

Archive Listings page not working after upgrade

Posted: May 31, 2018 at 4:24 pm


grossbauer

May 31, 2018 at 4:24 pm

Hello, I have an error with my listings not showing after the upgrade to 4.9.62.p

You can view the error here:
http://niboa.org/classes/

Any ideas?

Thanks,
Brian


Josh

  • Support Staff

May 31, 2018 at 4:35 pm

Hi Brian,

Is that an archive listing or is that a page with a listing shortcode? If the latter, does the error go away if you remove the shortcode?


grossbauer

June 1, 2018 at 6:11 am

It’s an archive listing, not a short code.

 global $wp_query;
                $args = array_merge( $wp_query->query_vars, ['posts_per_page' => 1000 ] );
                query_posts( $args );

                while (have_posts()) : the_post(); ?>
                    
                    <?php 
                      $hide_event = get_post_meta($post->ID, 'hide', true);

                      // show if not hidden 
                      if ($hide_event != "1" &&
                          $post->ID != 1289
                          ): 

                    ?>                    
                    <article <?php post_class(); ?>>


grossbauer

June 1, 2018 at 6:22 am

Here is sql error:

SELECT SQL_CALC_FOUND_ROWS wp_posts.*, wp_esp_datetime.* , MIN( wp_esp_datetime.DTT_EVT_start ) as event_start_date , wp_esp_datetime.* , MIN( wp_esp_datetime.DTT_EVT_start ) as event_start_date , MIN( wp_esp_datetime.DTT_EVT_start ) as event_start_date FROM wp_posts INNER JOIN wp_esp_datetime ON ( wp_posts.ID = wp_esp_datetime.EVT_ID ) INNER JOIN wp_esp_datetime ON ( wp_posts.ID = wp_esp_datetime.EVT_ID ) WHERE 1=1 AND wp_posts.post_type = 'espresso_events' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'cancelled' OR wp_posts.post_status = 'postponed' OR wp_posts.post_status = 'sold_out' OR wp_posts.post_status = 'private') AND wp_esp_datetime.DTT_EVT_end > '2018-06-01 12:18:11' AND wp_esp_datetime.DTT_EVT_end > '2018-06-01 12:18:11' AND wp_esp_datetime.DTT_EVT_end > '2018-06-01 12:18:11' GROUP BY wp_posts.ID ORDER BY event_start_date ASC LIMIT 0, 1000


Josh

  • Support Staff

June 1, 2018 at 7:14 am

Can you post the entire contents of the archive template into a pastebin or gist, then link to the code here?

There’s probably another way to query the posts than using query_posts() (using query_posts() is generally not recommended, even its documentation says not to use it). If you can share the entire contents of the template it will help us with understanding what’s going on.


grossbauer

June 1, 2018 at 7:37 am

It appears to work now. I removed an extra inner join… for some reason it was generated twice by the in the:

query_posts( $args );

sql statement.

Thanks,
Brian


grossbauer

June 1, 2018 at 7:39 am

Oh sorry, I did not realize query_posts should not be used. I will check that out. Thanks for all your help.

The support post ‘Archive Listings page not working after upgrade’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso