Aug 172010
 

Doing some work on the new Thunderhead WordPress based site today, and decided to use the ‘Events Calendar‘ plugin to manage all of the upcoming events that we are either interested in promoting or will be going to.

Anyway… I was using the sidebar widget that lists the events in a unordered list and found that the styles in the plugin and the way the list is built made the list look very different from the rest of my theme. The main culprit being the part where the list is built in the ec_calendar.class.php file of the plugin.

I made some changes to it and cleared out most of the list css in the plugin’s .css files and things are working like I want it. You will see from the before and after that I also added code so that the list items became links to either the external page, or to the internal event page that describes the event on our site if it exists.

Before

149
150
151
152
153
154
155
156
$PostID = isset($event->postID) ? $event->postID : '';
 
if ($PostID == '')
	$titlinked = '<strong>'.$day_names.' '.$startDate.'</strong>: ' . $event->eventTitle;
else
	$titlinked = '<a href="' . get_permalink($PostID) . '">'
				  . '<strong>' . $day_names . ' ' . $startDate . '</strong>' . __(': ', 'events-calendar')
				  . $event->eventTitle . '</a>';

After

149
150
151
152
153
154
$PostID = isset($event->postID) ? $event->postID : '';
 
if ($PostID == '')
	$titlinked = '<a href="' . $event->eventLinkout . '" target="_blank">' . $event->eventTitle . '</a>';
else
	$titlinked = '<a href="' . get_permalink($PostID) . '">' . $event->eventTitle . '</a>';

It is a simple set of changes, but I wanted to not only put them here to remember them, but if someone else starts playing with making the WordPress Event Calendar widget work the way they want in event list mode, hopefully they find this page.