bloqhead
10/31/2013 - 3:07 PM

A simple URL builder function for WordPress. Codex reference: http://codex.wordpress.org/Function_Reference/site_url

A simple URL builder function for WordPress. Codex reference: http://codex.wordpress.org/Function_Reference/site_url

<?php

/**
 * Site URL Builder
 * Usage: <?php bsd_url( 'page-slug', 'http' ); ?>
 */
function bsd_url( $slug, $protocol ) {
    $url = site_url( '/' . $slug . '/', $protocol );
    echo $url;
}

?>