Change site Logo h1 Tag

Change site Logo h1 Tag

By default In Porto WordPress, we have set the h1 tag for the Logo. So in order to change that h1 tag you have to use the Custom Code in Child Theme.

First of all, you have to go to Porto >> Setup Wizard >> Child Theme and Create the Child Theme from there:

After that, you have to copy and paste the below-given Code in your Child Theme functions.php file and change the tag in it as per your requirements:

add_filter( 'porto_logo', 'porto_child_logo' );
function porto_child_logo( $logo_html ) 
return str_replace( array( '<h1 class="logo">', '</h1>' ), array( '<h2 class="logo">', '</h2>' ), $logo_html );

It will change your Logo tag from h1 to h2.

Hope this helps 🙂

By porto_admin |