No Upcoming Events List view gives 404 error

Home Forums Calendar Products Events Calendar PRO No Upcoming Events List view gives 404 error

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #75679
    Denise Crosbie
    Participant

    When I view list view with no upcoming events the page returns a 404 error. It displays fine, but just returns 404 status in the headers. See here:
    http://www.frescolio.ca/events/upcoming/?tribe-bar-date=2014-01

    #75912
    Barry
    Member

    Hi Denise: when no events are returned a 404 status is indeed set – that’s because no event posts were found and so this actually parallels the behaviour of WordPress itself (if a query is received for posts but no matches are found) – the difference in your case is that it looks like, in the case of your theme, this also triggers a visible notice to alert users to the fact.

    I think the best way forward would to be to see if there is an easy solution by changing the template choice in Events > Settings > Display. Otherwise you would need to investigate customizing your theme (and you might wish to touch base with your theme vendor about doing so) to avoid this message displaying whenever a 404 happens to coincide with an events-related page.

    On our side, the following code can be used to detect if a page relates to events:

    if ( tribe_is_event_query() ) { /* Do magic */ }

    Hope that helps 🙂

    #77545
    Denise Crosbie
    Participant

    I solved it using a modified version of this code into my functions.php file: https://theeventscalendar.com/support/forums/topic/webmaster-tools-flooded-with-404s/#post-55397
    I just changes the eventDisplay option from “month” to “upcoming” and it removed the 404.

    #77615
    Barry
    Member

    Excellent: thanks for posting back with the solution 🙂

    #982255
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘No Upcoming Events List view gives 404 error’ is closed to new replies.