WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Simple Hack for Events Calendar Sidebar Widget (3 posts)

  1. shawnmcf
    Member
    Posted 4 years ago #

    I've seen a lot of posts about issues with the Events Calendar Sidebar Widget. One of the issues is the sidebar widget will display "Events are coming soon, stay tuned!" The following hack will work if you are trying to display a calendar NOT an event list in the widget. I'm able to get the calendar to display although it doesn't fit in the widget box (in my theme at least) and the title does not show up. It's good enough for me for now, but it looks like a few more tweaks could clean it up.

    I'm using WP 2.9 and Events Calendar 6.5.2.1. Here's the hack. Again use only if you want the calendar, not the list.

    Edit the file ec_widget.class.php (after making a backup) and change:

    function display($args) {
    $js = new EC_JS();
    extract($args);
    echo $before_widget;
    $options = get_option('widgetEventsCalendar');
    if(isset($options['title']) && !empty($options['title']))
    echo $before_title . $options['title'] . $after_title;
    if($options['type'] == 'calendar')
    $this->calendar->displayWidget($this->year, $this->month);
    else
    $this->calendar->displayEventList($options['listCount']);
    echo $after_widget;
    }

    to

    function display($args) {
    $js = new EC_JS();
    extract($args);
    echo $before_widget;
    $options = get_option('widgetEventsCalendar');
    if(isset($options['title']) && !empty($options['title']))
    echo $before_title . $options['title'] . $after_title;
    $this->calendar->displayWidget($this->year, $this->month);
    echo $after_widget;
    }

    The changes is simply removing a check to see if the widget options are set for "calendar" or "list" and assuming it is calendar.

    It's too bad the plugin developers have essentially gone silent for six months. Walking away from an open source project without saying that you're walking away is never a good idea. </rant>

  2. bluehaus
    Member
    Posted 3 years ago #

    Hey shawnmcf,

    Thanks for posting this. Although I was wondering if I could ask you a seemingly basic question. I can't get the calendar widget to display at all!?

    First, I'm new to WP and currently am using WP3 and version 6.6.2 of the Events Calendar plugin, so I'm sure that's probably my problem right from the get go.

    Currently I have the following code:
    <?php sidebarEventsCalendar();?>

    Which is displaying as:
    Fatal error: Call to undefined function sidebarEventsCalendar() in...

    Where can I find the sidebarEventsCalendar function to add to my functions file?

    Any suggestions or help would be greatly appreciated.
    Thanks in advance.

  3. bluehaus
    Member
    Posted 3 years ago #

    Please disregard my previous post. Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic