Posted: December 19, 2013 at 10:18 am
|
I need to embed the calendar on a specific page of the site but have the first month that shows to be March of 2014. How would I do that? Can I add some parameter to the shortcode? Thanks!
|
Hi Mike, Update: EE4 has a shortcode parameter that lets you start the display for a month in the future: While there is not a shortcode parameter for EE3’s calendar that does this, you can add one line of code to change the first month that gets displayed. This is for the current version of the calendar plugin: v.2.1: Another Update: Newer versions of WordPress have the wp_add_inline_script() functions, so no need to alter the calendar’s code directly as previously mentioned. Instead, you add this code to your website: https://gist.github.com/joshfeck/18dc736a58c2f95ca1858293cfea7e6e You can add the above to a functions plugin or into your WordPress theme’s functions.php file. Note that January = 0, so March is 2. The function reference: |
|
|
Thanks for the speedy reply!… I haven’t actually tried this yet That sounds like it would work fine for my page March.html where I want it to start with the March view; but What about my APRIL.html page where I want to start the calendar view on that page with April being first in view? Won’t that line of code make every iteration of the calendar start in March throughout the rest of my site? -Not what I’m trying to accomplish- Sorry to be a pain! Thanks again, |
|
Hi Mike, That’s correct, modifying the code in that way will make every instance of the calendar go to that page. However, looking at this it is quite simple to add in a shortcode parameter to change the behaviour. https://gist.github.com/Apina/8051946 Does that. it requires a line change in the espresso-calendar.php (it provides the full file) and also a line added to the espresso_calendar.js, hopefully the instructions are clear. I will make a request (though I cannot guarantee it will be accepted) for this or something similar to be added to the core calendar. |
|
Thanks for the Dean. Looks like that should do it. I’ll jump in. I’m pretty code shy; do you think the best way to approach this is to just replace the entire contents of my espresso-calendar.php file with the contents of the post you sent me to? Or just pull out the line I need from it? Also, i guess this means future updates to the plugin will probably break this customization, correct? That is, until you guys build it in anyway, huh? By the way, thanks for the new updates to the calendar from a couple of days ago. You guys really improved the look and feel of it! Thanks again, |
|
Hi Mike, If you are using version 2.1 of the calendar you can just copy all the code and replace it in the espresso-calendar.php file. The JavaScript will need to be added to the other file as well, the same place Josh told you to place it, but this line si a little different to the one Josh suggested. $('#espresso_calendar').fullCalendar( 'gotoDate', eeCAL.custom_year, eeCAL.custom_month); It looks like my suggestion is being considered for future calendar updates, but yeah if you update the calendar and the feature hasn’t been added you will lose the changes made. Thanks for the feedback over the calendar, and I’m really happy you like it, we have tried to make it cleaner and faster |
|
Thanks again Dean. Got it. |
The support post ‘Calendar: Start Display for a month in the future’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.