How to link to current post in WordPress?

This is exactly the type of scenario shortcodes are intended for. Simply add the following to your theme’s functions file to create the shortcode:

add_shortcode( 'this_permalink', 'this_permalink' );

function this_permalink($atts, $content){
   return '<a href="'. get_the_permalink() .'">Link to this article</a>';
}

.. and use this in your post to render the link:

[this_permalink]

I cannot think though, why you would want to link to a current article, but I guess you have your reasons 🙂

tech