Avoid hard-coding URL’s

When you build your WordPress website you will often have to create links that point to other pages within your website. Don’t hard-code these links but use the site_url() function to create the proper URL’s:

<a href="<?php echo site_url("/some/page") ?>">Some Link</a>

Easy huh?

Bon App├ętit!

Tagged with: