Hey Stephen,
Just bought Pro and am loving everything!
I’m wondering how to make a few changes to the calendar widget.
- Change the tfoot text to say “Next” and “Prev” instead of the month abbreviations
- Change the day abbreviations in the thead to “Mon, Tues, Wed…” instead of “M, T, W”
I tried messing around to make this work, but was wondering if you had done this before and have a solution?
Thanks.

pach16
I’m also interested in editing the layout of the widget in a way that can’t be done with CSS I’d like to move the next previous functions into the head of the table and have arrows instead of text. I can see that editing class-eo-calendar-widget.php would allow for this, but that would change with updates. Any other suggestions or plans to make the widget an editable template at all? Thanks
-
This reply was modified 11 years, 5 months ago by
boldfish.

boldfish
If you want to put the next/previous in the thead with css, just make the calendar widget position: relative;
. Then set the tfoot to absolute positioning.

pach16
Hi pach16, boldfish,
As noted you can edit the calendar widget class, but changes will be lost with updates. There’s no wary round this currently… except by creating a new widget, which extends EO_Calendar_Widget
. In this way you inherit all the methods, but you are able to copy and rewrite generate_output()
:
class My_EO_Calendar_Widget extends EO_Calendar_Widget{
function __construct() {
$this->id_base = 'my_eo_calendar_widget';
$this->name = 'My Events Calendar';
$this->option_name = 'widget_' . $this->id_base;
$this->widget_options = array( 'classname' => 'widget_calendar eo_widget_calendar' );
$this->control_options = array( 'id_base' => $this->id_base );
}
static function generate_output( $month, $args = array() ){
/* ... copy from original class and adapt as required ... */
}
}
function myplugin_register_my_eo_calendar_widget() {
register_widget( 'My_EO_Calendar_Widget' );
}
add_action( 'widgets_init', 'myplugin_register_my_eo_calendar_widget' );
Care should be taken to ensure this is declared after EO_Calendar_Widget
. It should be ok in functions.php
, but if its in a plug-in, ensure that it lives in a file which is included on plugins_loaded
action.
While I’ll consider using a template for the calendar for EO 2.4 (2.3 is being released over the weekend), the above method is probably the best.

Stephen Harris