WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
Calendar and Events Page View Problem (10 posts)

  1. titlehere
    Member
    Posted 2 years ago #

    Hey! The new plugin looks great from what I've seen. Unfortunately adding the tweak to view the events in the main blog loop to my functions.php causes the calendar/events list to no longer display on the events page.

    This is what I added to my functions.php:

    add_filter( 'pre_get_posts', 'include_events_on_home' );
    function include_events_on_home( $query ) {
    if ( is_home() && false == $query->query_vars['suppress_filters'] )
    $query->set( 'post_type', array( 'post', 'tribe_events', 'attachment' ) );
    return $query;
    }

    I have confirmed removing it allows the calendar/events list to display perfectly, but for some reason it does not like it otherwise.

    Ideas?

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Hi. I can try to help you out on this, any chance you can link me to your site?

  3. titlehere
    Member
    Posted 2 years ago #

    Thanks for the reply. I am one of the "code tinkerers", as it is a custom theme, and that's probably where the problem lies, but here is the link to the site calendar:

    http://fmderbygirls.com/events/

  4. richot
    Member
    Posted 2 years ago #

    I'm having this same issue. I've added that tweak to functions.php (as per the FAQ), it works like a charm with respect to showing events with regular posts on the home page, but it also seems to break the "Default View for the Events" setting.

    Regardless of which value I select for "Default View for the Events", the result is mysite.com/events shows more of an event list. I can no longer get it to show the Calendar format, which is what I'm after.

    If I remove the new code for this tweak, i.e. the include_events_on_home function, things work fine again (I get my calendar back)

    Was any resolution found for this? Maybe I should start a new post?

    WordPress 3.3.1
    The Events Calendar 2.0.3
    A very new site, still building it out, not other php tweaks, etc.

  5. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Hi Richot. Thanks for the heads up; I'm not sure what could be going on here, but let me see if one of our devs can see what the problem is. Any chance you could share the code you're using so we can see what we're working with here?

  6. richot
    Member
    Posted 2 years ago #

    Hi roblagatta, thanks for the interest in helping. I'm using the blurb directly from the FAQ
    here.

    add_filter( 'pre_get_posts', 'include_events_on_home' );
    
    function include_events_on_home( $query ) {
    
    if ( is_home() && false == $query->query_vars['suppress_filters'] )
    
    $query->set( 'post_type', array( 'post', 'tribe_events', 'attachment' ) );
    
    return $query;
    
    }
  7. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Thanks Richot. We're doing a round of OS forum support this week, so I'll get a dev to take a look with what you've provided. Thanks for sharing and my apologies for the inconvenience so far.

  8. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Sorry about the delay here...not sure how this one slipped through the cracks, but it's on the devs plate for today.

  9. richot
    Member
    Posted 2 years ago #

    Excellent, thanks for following up.

  10. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Hey again. So I had a dev from the team take a look here, and it looks like that FAQ item was a one-off solution that worked for a few users but isn't a widespread solution. Thanks for the heads up; we've removed it accordingly.

    We're working on a legitimate solution for this in 2.1, and that will be included in the initial 2.1 release when the code ships. Apologies for the inconvenience in the interim.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic