Switching to different language sends you back to the home url of that language.

Home Forums Calendar Products Events Calendar PRO Switching to different language sends you back to the home url of that language.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #966511
    Jonathan Hawkes
    Participant

    This is apparently an issue that has plagued many people. I couldn’t find an answer so I solved it, and thought I’d share.

    From what I can tell, is the Events Calendar does not use an archive page, so when the custom post type is created you get:

    'has_archive' => FALSE

    To fix this:

    add_action( 'init', 'change_tribe_events_rewrite_rules', 999 );
    function change_tribe_events_rewrite_rules() {
        global $wp_post_types;
        $has_archive = &$wp_post_types['tribe_events']->has_archive;
        $has_archive = TRUE;
        $rewrite = &$wp_post_types['tribe_events']->rewrite;
        $rewrite['slug'] = __('events', 'nereus');
    }

    This may be considered a hack, but sadly there is no information anywhere to be found on how to solve it.

    Hopefully this helps others in the future.

    #966620
    Geoff
    Member

    Hi Jonathan,

    Thanks for sharing! I love that you’ve taken the time to not just report the issue but propose a solid solution as well–you rock. 🙂

    The calendar itself is a custom archive, so it would definitely be strange for has_archive to return false like that. I’ll make that’s noted for us to look into but, in the meantime, thanks again for posting your solution–I’m sure others will find it useful as well.

    Cheers!
    Geoff

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Switching to different language sends you back to the home url of that language.’ is closed to new replies.