Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

post_link_shortcode

// Add Shortcode
function post_link_shortcode( $atts ) {

	// Attributes
	extract( shortcode_atts(
		array(
			'id' => '',
		), $atts )
	);

	// Code
if ( isset( $id ) ) {
	return '<a href="' . get_permalink( $id ) . '">' . get_the_title( $id ) . '</a>';
}

}
add_shortcode( 'link-to-post', 'post_link_shortcode' );