Changing the code format for wordpress

First thing’s first, we need to get our globals. If you’re in The Loop you can remove the global $post in my code, if you’re outside The Loop $post may not be what you expect it to be. We’ll always need the global $userpro though.

<?php 
    global $userpro,
            $post;
?>
<div class="myrelatedauthor">
    <a href="https://wordpress.stackexchange.com/questions/180751/<?php echo $userpro->permalink( $post->post_author ); ?>">
        <?php echo get_the_author_meta( 'display_name', $post->post_author );?>
    </a>
</div>

The key differences between your code and my code is that I include global $post and global $userpro. I also echo out the value returned from from $userpro->permalink().