Posted by admin on

Adding an Event to a Calendar

I wanted to add a widget to a wordpress web article that allowed readers to add the event to their calendars. I found the site called, “AddEvent“. Fabulous. Proving that doing one thing well is all a web service has to do.
This page records how I implemented this, and has an example event and widget.
The implementation comes in two parts, the reference to a script, which I would normally put in the HEAD section and the definition of the event which is HTML and needs to be located where you need the button/widget i.e. within the Post/Page content. I have placed the event definition into a code snip aka a custom field.
%CODE1%
When implementing this in wordpress, the javascript reference needs to be located as near but before the </BODY> tag. In my case I needed to edit the footer.php file, which meant copying the footer.php file to the child theme in the case of this wiki and creating a child theme for ello.davelevy.info which uses the minnow theme.
N.B. This widget implementation does not offer a Facebook event since it needs a source and I have not set one up.


Comments ( 2 )

  1. Dave
    I originally had a bug caused by locating the script in the HEAD section. The button did not have its icon and no action was taken when the button was pressed in some browsers. I moved the script reference to the footer.php file today and it seems to be working well now. I have not yet tested this with Safari. I have amended the article to emphasis the need, when using wordpress to locate the SCRIPT tags at the end of the HTML file.
  2. Dave
    I returned to this today. I opened a hobby account, the script name is still valid, I needed to change the client id, to reflect the new account. Because it's a hobby account, it needs the single permitted domain name to be set manually. And that's it!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close