Home › Forums › Calendar Products › Events Calendar PRO › Calendar view: Can I specify a start month?
- This topic has 10 replies, 2 voices, and was last updated 13 years, 3 months ago by
Barry.
-
AuthorPosts
-
December 5, 2012 at 11:57 am #28999
Kristin
ParticipantHi there,
In the calendar view, I want to know if there is a way to specify the start month. For example, I just installed this plugin in November and I’m using it to import Facebook events. I don’t have any need to go back and import the expired events for the months before November (October 2012 and previous). Can I please specify this somewhere so that a visitor to my site can’t click to view a month before November 2012? The calendar view for those months will be entirely blank and I know that’ll look bad. There was lots of stuff happening but it’s just too time-consuming to populate the events calendar with all the expired events.The calendar view is here http://tangosocialclub.ca/eventscalendar/
Thank you!
KristinDecember 6, 2012 at 7:58 am #29051Barry
MemberDefinitely possible; if Events > Settings > Template > Events Template is set to Default Events Template then you could make a customization to your ecp-page-template.php template.
Before you do anything though, please familiarize your self with template overrides!
The general idea would be to locate the following line within that template:
if ( !defined('ABSPATH') ) { die('-1'); }Add a little space and drop this code in http://pastebin.com/Mg8c0XEX – what it aims to do, if possible and if something earlier than the this month has been requested, is redirect people to the blog’s homepage.
If a redirect isn’t possible it will try to show a 404. You can tweak to your specific requirements.
December 13, 2012 at 12:33 pm #29436Barry
MemberHi Kristin – I’m guessing you are all sorted here and will close this thread shortly: in the event you need further help please post back in the next couple of days ๐
December 13, 2012 at 1:19 pm #29440Kristin
ParticipantSo I need to make an events folder in my theme directory, then copy the ecp-page-template.php and paste it in that new folder all by itself?
Which do I specify as October 2012? month? Please be more specify. I looked at the code I can paste, but I don’t know how to customize it for my purposes (ie. I don’t want to show the calendar before October 2012, only October 2012 and forward).
Thanks!
KristinDecember 13, 2012 at 1:51 pm #29442Barry
MemberHi Kristin!
So I need to make an events folder in my theme directory, then copy the ecp-page-template.php and paste it in that new folder all by itself?
Yes.
Which do I specify as October 2012? month? Please be more specify. I looked at the code I can paste, but I donโt know how to customize it for my purposes (ie. I donโt want to show the calendar before October 2012, only October 2012 and forward).
So currently it assumes that visitors shouldn’t see anything before the current month (December 2012 right now, for instance). If you would prefer to fix that date as October 2012 then find this line:
$thisMonth = date('Y-m').'-01';And change it to:
$thisMonth = '2012-10-01';Does that help?
December 27, 2012 at 9:19 pm #30051Kristin
ParticipantHi again, ๐
I followed the instructions carefully and edited the template and such. It doesn’t seem to be working. Can you help?
My event calendar is here and this is what displays when I selected July 2012:
http://tangosocialclub.ca/eventscalendar/2012-07/Ideally, I don’t want to see the Month Name (with arrows shown in orange) for any date earlier than November 2012. And the drop-down list of months should start at November 2012. Is that what the template override was meant to do? Just curious. I was hoping there would be a way for any months prior to November 2012 to not appear at all. I don’t want the previous months to be selectable since the calendar will be entirely blank before November 2012. If that’s not possible, just let me know and I’ll abandon my dream. ๐
Thanks again so much for your help!
KristinDecember 28, 2012 at 6:16 am #30063Barry
MemberIdeally, I donโt want to see the Month Name (with arrows shown in orange) for any date earlier than November 2012. And the drop-down list of months should start at November 2012. Is that what the template override was meant to do?
No, that’s not the aim. What it tries to do is detect requests for calendar views earlier than a certain date and then redirects those requests to the homepage (or wherever else you specify – for example, if you preferred, it could be the earliest possible date that you will allow them to see). It doesn’t affect the navigation links/dropdowns at all.
What you want to do with the month navigation is possible, but something like this, although totally possible, is quite involved:
And the drop-down list of months should start at November 2012.
So I can’t help out with that simply because we have a limited amount of bandwidth with which to support everyone. What we could do however is hide the previous month link if it is for a month you don’t want to show.
I’d like to make sure everything else is working as expected first of all, though, so could you share your customized ecp-page-template.php (using a service like Pastebin or Gist) and confirm where it is located relative to the wp-content directory?
January 3, 2013 at 11:03 am #30267Kristin
ParticipantThe customized template is here:
/home/tangosocialclub.ca/site/www/wp-content/themes/headway-2013/eventsHere is the template:
http://pastebin.com/zTzhbL0mYes please, I would like to hide the previous month link on the November 2012 page. Thanks!
January 3, 2013 at 12:05 pm #30271Barry
MemberSo regarding the initial change I suggested, you do need to have selected Default Events Template in Events > Settings > Template for this to work – can you confirm if you have done that?
January 5, 2013 at 1:45 pm #30324Kristin
ParticipantI did that now. But I just updated my headway theme to a 2.014 version and now I can’t create the events folder inside the theme directory (like I had done for version 2.013 of my theme). I get a permission denied error. I’ve written to headway for support but am waiting to hear back. Until I solve that issue I don’t know if the customization is working. ๐
January 7, 2013 at 8:45 am #30362Barry
MemberOK, well let’s leave this open until you can get that customization in place; if it’s a permission denied error it might relate to file permissions rather than being a Headway-specific problem, so also consider seeking support from your web hosting provider or do a search for file permissions to learn about this.
-
AuthorPosts
- The topic ‘Calendar view: Can I specify a start month?’ is closed to new replies.
