Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter themarblery

    (@themarblery)

    OK, so I found what I did wrong. I had the following in my functions.php file.

    function order_events($query) {
    
    	global $wp_query;
    
    	if( $wp_query === $query && is_post_type_archive("event") ) {
    		$query->set( "event_start_before", "today" );
    		$query->set( "orderby", "eventstart" );
    		$query->set( "order", "DESC" );
    	}
    
    }
    add_action("pre_get_posts", "order_events", 1);

    Needed to make this only apply to my theme, and not the admin, so I changed…

    if( $wp_query === $query && is_post_type_archive("event") ) {

    to…

    if( !is_admin() && $wp_query === $query && is_post_type_archive("event") ) {

    and that fixed everything.

    Should have noticed that sooner. Thanks for the great plugin!

    Thread Starter themarblery

    (@themarblery)

    Hey Stephen,
    It wasn’t any plugin, but it was my custom theme. Sorry to waste any of your time. I’ll just have to hunt down what’s causing that. Thanks for the speedy response!

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