I got it to work by installing this plugin:
https://www.ads-software.com/extend/plugins/exec-php/
Then pasting this code into the HTML view of the post/page:
<?php sidebarEventsList($number_of_items);?>
For example, use this to display 30 events:
<?php sidebarEventsList(30);?>
PS Note, if you flip back to non WYSIWYG mode, it’ll delete the PHP code so you’ll have to continue to work in HTML view on that page.