Set default page if no events?

Home Forums Calendar Products Events Calendar PRO Set default page if no events?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32164
    Son
    Participant

    Hi. I didn’t build this site originally, but I’ve been asked to do some work on it. At present this is the site’s events page:
    http://newurbanlearning.org/events
    If there are no upcoming events, the page defaults to the blog (if there are future events I get a calendar view)–right now there are none. I can’t find anywhere in the plugin settings to change this. What I would like is either to show the calendar page (with past events) or have it default to a page I select or setup in WP. Can you please advise on the best way to handle this? I’ve searched the forums, looked at the docs, etc. and can’t find anything on it.

    #32186
    Jonah
    Participant

    Hi Son,

    The only thing I can think of would be to implement a conditional PHP redirect so that if there are no events in the list, redirect to wherever you want. Here is some documentation on doing a PHP redirect: http://www.tripwiremagazine.com/2011/04/php-redirect-to-another-page.html – you would want to put that somewhere in /wp-content/plugins/the-events-calendar/views/list.php after line 113 which is the else condition in the statement for whether or not there are events. Make sure to make a copy of list.php and put in an ‘events’ folder in your theme before making any changes. This will preserve them if you update the plugin.

    Does that help?

    – Jonah

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Set default page if no events?’ is closed to new replies.