How to Change the Destination URL for Website Logo?

By default, clicking on the website logo directs the user to the front/home page. In case, you need to change the destination for the logo use following custom code.

Note: Paste the code to the child theme’s functions.php file.

add_action('astra_masthead', 'astra_logo_change_url');

function astra_logo_change_url(){
remove_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
add_filter( 'home_url', 'astra_logo_custom_url' );
add_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
}

function astra_logo_custom_url( $url ) {
return 'http://google.com';
}
add_action('astra_masthead_content','astra_remove_logo_custom_url',9);
function astra_remove_logo_custom_url(){
remove_filter( 'home_url', 'astra_logo_custom_url' );
}

Make sure you replace the test URL (http://google.com) with your destination URL in the above code.

Not the solution you are looking for? Check other articles, or open a support ticket.