Using the following snippet and pasting it in your theme’s functions.php file will let you get the first link in post.

Snippet Source/Credit: Filip Stefansson