How to link Tagline to Site URL in Genesis

Want to make the site description clickable to the homepage?

Here’s one way in which this can be done.

add_filter( 'genesis_markup_site-description_open', 'insert_html_opening_site_description_markup', 10, 2 );
/**
 * Appends HTML to the opening markup for .site-description.
 *
 * @param string $open_html HTML tag being processed by the API.
 * @param array  $args       Array with markup arguments.
 *
 * @return string
 */
function insert_html_opening_site_description_markup( $open_html, $args ) {
    if ( $open_html ) {
        $additional_html = '<a href="' . trailingslashit( home_url() ) . '">';
        $open_html = $open_html . $additional_html;
    }

    return $open_html;
}

add_filter( 'genesis_markup_site-description_close', 'insert_html_closing_site_description_markup', 10, 2 );
/**
 * Appends HTML to the closing markup for .site-description.
 *
 * @param string $close_html HTML tag being processed by the API.
 * @param array  $args       Array with markup arguments.
 *
 * @return string
 */
function insert_html_closing_site_description_markup( $close_html, $args ) {
    if ( $close_html ) {
        $additional_html = '</a>';
        $close_html = $close_html . $additional_html;
    }

    return $close_html;
}

Code goes in child theme’s functions.php.

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.