Why the pre_get_posts hook can cause apache stopped working?
As per this WPSE thread you are actually putting overload to the apache. That’s why it’s reacting like that. 🙂 So let’s cut the overload, use is_main_query() properly, and just add a simple conditional to your pre_get_posts hooked function: function e_exclude_posts( $query ) { if( !is_admin() && $query->is_main_query() && $query->is_tax(‘my_tax’) ) { $expired = g_get_all_the_expired_posts(); … Read more