Header.php not present in child theme

Hello!

I’m using Pro Child theme, and wish to insert
<?php if ( 6 === get_current_blog_id() ) { echo ; } ?> before the </head> but I couldn’t find the header.php under editor for the child theme. Do I need to take some additional steps in order get that under the editor?

Please note functions.php is very much existent under the child theme.

Thanks!

Hi,

You can use wordpress hooks to inset it in the head,

You can add the code below in your child theme’s functions.php file

function add_custom_meta() {
   if ( 6 === get_current_blog_id() ) {
       echo '<meta name="theme-color" content="#ff6600" />';
   }
}
add_action( 'wp_head', 'add_custom_meta' );

For more information kindly refer to the link below

https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.