Events Calendar Breaks Tag Archive

Home Forums Calendar Products Events Calendar PRO Events Calendar Breaks Tag Archive

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1018716
    Jon Chabun
    Participant

    On our site, Events calendar seems to break the tag archive page. We’ve tried reverting to the default wordpress theme, and uninstalling all other plugins.

    I saw a few threads regarding similar issues on previous versions, but the fix (https://gist.github.com/jazbek/7442734) did not seem to work for us.

    Any advice?

    #1018735
    Geoff
    Member

    Hey Matt, and sorry for the issue here!

    I think that snippet is a little dated because it’s missing some name-spacing that we’ve introduced in newer versions. Try this snippet instead and let me know if that makes a difference instead.

    Thanks!
    Geoff

    #1018736
    Jon Chabun
    Participant

    I’m assuming this won’t break anything when the plugin is updated?

    #1018852
    Geoff
    Member

    It’s possible the function itself may not work after an update, but it won’t break the calendar itself.

    Thanks,
    Geoff

    #1019904
    Jon Chabun
    Participant

    I don’t see the snippet you referred to…

    #1019907
    Geoff
    Member

    Ack, sorry about that! Looks like our site is having a little bit of an issue with embedding Gists at the moment.

    Let’s try that again:

    https://gist.github.com/geoffgraham/3f3e25f88856cb6c51cf

    #1019912
    Jon Chabun
    Participant

    Thanks – I’ll give that a try…

    #1019913
    Geoff
    Member

    Right on, thanks!

    Do note that the opening PHP tag is probably not needed in your file. 🙂

    #1019923
    Jon Chabun
    Participant

    Hi Geoff,

    I think that’s probably close, but I get the following error message on that page with that snippet in our functions file:

    Fatal error: Class ‘Tribe_Events’ not found in /Users/mikelathrop/Dropbox/1work/www/mfrc/wp-content/themes/bms-barebones/inc/custom.inc.php on line 55

    In my editor, I see when I highlight Tribe__Events on line 5 of the gist, it wants to autocomplete with a number of other classes that start with Tribe__Events (Tribe__Events__Abstract_Deactivation, Tribe__Events__Activation_Page, etc, etc). Is it just a matter of finding the right class with the POSTTYPE array in it that we’re after?

    #1019993
    Geoff
    Member

    Hmm, i’m not getting the same fatal error when using the snippet. Let’s try this again with exactly what needs to be pasted in:

    https://gist.github.com/geoffgraham/3f3e25f88856cb6c51cf

    Please give that a shot and let me know if it makes a difference.

    Thanks and sorry for the back-and-forth here!

    Geoff

    #1020353
    Jon Chabun
    Participant

    That didn’t work either, but it looks like this did:

    <?php
    add_action( 'parse_query', 'tribe_fix_tag_query' );
    function tribe_fix_tag_query( $query ) {
    	if ( $query->is_tag && (array) $query->get( 'post_type' ) != array( Tribe__Events__MAIN::POSTTYPE ) ) {
    		if ( empty( $query->query_vars['post_type'] ) ) {
    			$query->query_vars['post_type'] = array( 'post' );
    		}
    		if ( ! ( $query->query_vars['post_type'] == array( 'post' ) || $query->query_vars == 'post' ) ) {
    			remove_action( 'parse_query', array( 'Tribe__Events__Query', 'parse_query' ), 50 );
    			remove_action( 'pre_get_posts', array( 'Tribe__Events__Query', 'pre_get_posts' ), 50 );
    		}
    	}
    }
    ?>

    Do you see any problem with referencing Tribe__Events__MAIN::POSTTYPE instead of Tribe__Events::POSTTYPE? Is there anything in particular we should test to see if that would break something?

    Cheers,

    Mike

    • This reply was modified 10 years, 5 months ago by Jon Chabun.
    #1020360
    Geoff
    Member

    That should be fine to use. Give that a shot for sure!

    #1075270
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Events Calendar Breaks Tag Archive’ is closed to new replies.