[Plugin: All In One Event Calendar] How to add shortcode manually
-
Hi everyone.
If you ever wanted to have a shortcode like [ai1ec cat=”15″] and waited really long release by release to get it. Here is the solution.
Note:
1. This changes the plug-in code. So backup your All-in-one-event-calender plug-in before starting.2. All changes will be away after updating to new version. Hopefully then there will be the shortcode by default :]
Add Shortcode: Step-by-step:
1. in /plugins/all-in-one-event-calendar/app/controller/class-ai1ec-app-controller.php at line 139:
Add the following code for gatting called within posts. Shortcode will only work in postlist, not on site. I needed it this way. If nessessary comment please.
add_filter( 'the_content', array( &$this, 'append_content' ), PHP_INT_MAX - 1 );
2. in /plugins/all-in-one-event-calendar/app/controller/class-ai1ec-app-controller.php at line 408:
Add additional function for shortcode without check of page id
[Code moderated as per the Forum Rules. Please use the pastebin]3. in in /plugins/all-in-one-event-calendar/app/controller/class-ai1ec-app-controller.php at line 468-471:
Replace code to add calender at the point where shortcode is positioned and not at the end.
[Code moderated as per the Forum Rules. Please use the pastebin]4. in /plugins/all-in-one-event-calendar/app/controller/class-ai1ec-calender-controller.php at line 217:
Add additional view function for shortcode:
[Code moderated as per the Forum Rules. Please use the pastebin]5. Change your template Style.css:
Add the styles for calender by adding following line to youre theme style.css (sorry did not found another solution)
@import "../../plugins/all-in-one-event-calendar/css/calendar.css";
6. optinal: in /plugins/all-in-one-event-calendar/app/view/calendar.php at line 41:
Add a linebrake, so that callender fids into your page. Just try it out first ??
=> change <td> to</tr><tr><td>
7. Add shortcode
=> Add[ai1ec]
in a post and it will work.
=> call a calender with a default category[ai1ec cat="15"]
Will call calender with category 15. this is the category id. For multiple categories use[ai1ec cat="14,15"]
=> call a calender with a default tag[ai1ec tag="6"]
Will call calender with tag 6. this is the tag id. For multiple tags use[ai1ec tag="6,7"]
=>=> have fun! ??
No features:
– use in sidebar
– mutiple calender in a post => possible by decomment line 497 in app controller.php. search for//$content= $this->append_content( $content );
(but all callender will have same behavier due to singleton pattern in plugin. Just try it if you like to…I hope I could help you a bit. And please comment it, if something is not working on your side.
@yani.iliev: Sorry for hacking your faboulos plugin. I needed this functionality ??
Greets
Michaelhttps://www.ads-software.com/extend/plugins/all-in-one-event-calendar/
- The topic ‘[Plugin: All In One Event Calendar] How to add shortcode manually’ is closed to new replies.