The following snippet will let you crop medium thumbnail in WordPress.

Snippet Source/Credit: Stack Overflow