Hi @ninomiho,
Please do not share any sensitive information, including system information, in WordPress Forums; this is for us to follow the WordPress Forum Guidelines. If possible, edit the ticket and remove the system information, or ask the moderator to do this.
I’m unable to reproduce this issue on my website with Astra or other themes, so there could be a server-related issue. Have you tried contacting your hosting provider? Are there any other errors in the log file?
Does increasing the memory to 1024M solve the problem?
Hi Atousa!
The issue occurs because I have over 2,000 events in the plugin. I’ve limited the tribe_events per page to 10 in the customizer, and now it works. Here is the code in case someone else encounters the same issue.
/**
* Cap Events Calendar queries for customizer preview for memory issues.
*
* @param WP_Query $current_query The current query object.
*
* @return void
*/
function mc_limit_tribe_queries( $current_query ) {
if ( ! ( $current_query instanceof WP_Query ) ) {
return;
}
if ( 'tribe_events' !== $current_query->get( 'post_type' ) ) {
return;
}
if ( ! is_customize_preview() ) {
return;
}
$posts_per_page = (int) $current_query->get( 'posts_per_page' );
if ( $posts_per_page <= 0 || $posts_per_page > 10 ) {
$current_query->set( 'posts_per_page', 10 );
}
$current_query->set( 'no_found_rows', true );
$current_query->set( 'update_post_meta_cache', false );
$current_query->set( 'update_post_term_cache', false );
}
add_action( 'pre_get_posts', 'mc_limit_tribe_queries', 9 );
I’ve reported the topics to the moderators to remove the system information from my first message.
Hi @ninomiho ,
Thank you for your message.
We’re glad to hear that you were able to sort this one out, and we appreciate you sharing your code/solution.
I’ll be closing this thread, as there are no further actions needed, but please do not hesitate to bump a new thread on our way if you have further questions/concerns. This is for us to track down topics/issues efficiently and for us to adhere to the WordPress Forum Guidelines.
If you have some time to review, that would be amazing!
https://ww.wp.xz.cn/support/plugin/the-events-calendar/reviews/