• Resolved themarblery

    (@themarblery)


    Just started using the Event Organiser plugin, and love it so far. Ran into one issue, though, that confused me. If I create an event with dates in the past it displays in the WordPress admin when you navigate to the “Events” tab in the sidebar. However, if I create an event planned for a future date, it doesn’t display in the list of events. The only way that I can find the event again is if I go to the “Calendar View”. I guess that’s “fine”, but I would have thought that all events would display.

    The events display as expected in the front-end of my site, so I’m asking from a maintenance perspective. When I pass this along to the client, it’d be best if all events were listed together for easy editing.

    Anyone else experiencing this problem?

    Thanks,
    Ryan

    http://wordpress.org/plugins/event-organiser/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    Hi Ryan,

    Have you tried disabling other plug-ins. That’s not normal behaviour :/

    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!

    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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Future Events not displaying in WordPress Admin’ is closed to new replies.