Today I ran into a frustrating issue where a simple “get_posts()” query was not working in a custom widget.  The query worked fine when embedded into the page template.

The solution was actually quite simple – calling global $post; before my query in the widget did the job!

Movin’ on up!

Thanks to Aaron  and Matt for helping find a solution!