Skip Navigation

[Resolved] View's Archive overrides the Modern Tribes Events.How do I disable the archives?

This thread is resolved. Here is a description of the problem and solution.

Problem: Layouts and the Modern Tribes Events Calendar plugin don't work together and can't be made to.

Solution: Use Layouts as normal for your site except for the page where you will be using the Events Calendar plugin. For that page you will need to create a custom PHP template called archive-tribe_events.php. As a starting point you can copy the archive.php which is normally included with most themes and then customise that.

Relevant Documentation: N/A

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.52 hours from now. Thank you for your understanding.

This topic contains 5 replies, has 2 voices.

Last updated by rosemaryW 4 years, 4 months ago.

Assigned support staff: Nigel.

Author
Posts
#399675

I am trying to: Turn off the archives for the Events page.

I visited this URL: mysite.com/events/

I expected to see: hidden link

Instead, I got: "ARCHIVES BY MONTH:"

I tried to "Dont use any content template" in the settings, and it did not work.

#399866

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Did you fix this already? When I visit your site I see a fully functional calendar with parametric search at the url hidden link rather than a monthly archive.

For any post type (standard posts or custom) WordPress uses template files to display a single post or an archive of the posts.

Toolset lets you replace the standard template files (which are part of your theme) with your custom Views Content Templates. If you choose not to use a Content Template for displaying a single post or an archive of posts then the template file from your theme will be used instead.

#399967

Aloha Nigel,

Sorry for the confusion, but "wpshindig" is just a demo of the Modern Tribes Calendar plugin.
I was just showing what I expected to see or what I see when I deactivate Views.

I have a test site that I could send you credentials for.

You can easily recreate the problem on your local builds by:
1. installing this plugin, https://wordpress.org/plugins/the-events-calendar/
2. Install the wp-types suite
3. Go to mysite.com/events/
4. Confirm that you see an archive page
5. Deactivate Views
6. go back to mysite.com/events/ and see something similar to wpshindig.

Is there anyway I could "reregister" the archive functionality for "Events"?

Thank you,
Rosie

#400035

Aloha Nigel,

After some more trouble shooting, the conflict is with Layouts and the Modern Tribes Events, not Views.

Thank you,
Nathan

#400149

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I have spent quite some time testing (and discovered from our own forums and the modern tribe forums that I'm not the first) and was unable to get Layouts and the Events Calendar to work together.

In theory, it should be possible to use the information about customising the Events Calendar (hidden link) and about making themes compatible with Layouts (https://toolset.com/documentation/user-guides/layouts-theme-integration/) to get them to work together, but in practice I could not.

The problems arise because the Events Calendar is not using the standard WP loop, and because both Layouts and the Events Calendar are trying to alter the standard WP template hierarchy.

Here is what I found from my testing that may be of help. Do not try to assign Layouts to the events archive or to create a custom WordPress archive for events.

With Layouts de-activated, when you visit the events page the Events Calendar will use the standard page theme template. With twentysixteen that is page.php, for example. (If you change the settings for the Events Calendar so that it uses the Default Events Template then it will use default-template.php as described in the above Modern Tribe documentation.)

When Layouts is activated, the template routing of Layouts seems to trump that of the Events Calendar Plugin. If you don't design and specify a layout for events then it will use your theme's generic archive.php template. The event calendar displays correctly, but it is displayed using a template determined by the normal WordPress template hierarchy, which means archive.php.

Rather than edit that file (where changes you make will affect other WordPress archives which use the same template) you can copy the contents of archive.php to a file archive-tribe_events.php and any changes you make there will only affect the events calendar page. (Note, for this to work you must in your Events settings in the display tab choose the default page template.)

So, in summary, layouts and the events calendar conflict with each other. You can use layouts for your site on every page except the events calendar, which—according to the steps outlined above—will use the template file determined by the WP template hierarchy, which means you can create a custom template file (archive-tribe_events.php) to design your page.

#404919

Aloha Nigel,

Thank you for the fix. The archive-tribe_events.php child override worked perfectly.

Thank you,
Nathan