To create a shortcode for links, we need to include the attribute information as well as the anchor text for the link itself. We can do this by placing this function in your theme’s file:hreffunctions.php
Please Login or Register to see this code
Then, when creating a post, emulate the following format to include any links you wish:
[link href="https://perishablepress.com/"]Perishable Press[/link]
..which will output the following code:
<a href="https://perishablepress.com/">Perishable Press</a>
When the attribute is removed from the shortcode, the default URL will be used. You may specify the default URL in the third line of the funtion (see comment).href