{"id":9672990,"date":"2017-11-11T13:17:17","date_gmt":"2017-11-11T13:17:17","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/changing-theme-header-code\/"},"modified":"2017-11-11T13:17:17","modified_gmt":"2017-11-11T13:17:17","slug":"changing-theme-header-code","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/changing-theme-header-code\/","title":{"rendered":"changing Theme Header code"},"content":{"rendered":"<p>SSO plugin informs me:<br \/>\nThe &lt;head&gt; HTML tag in your header templates should include a function, action, or filter for its attributes. Change the existing &lt;head&gt; HTML tag to:<\/p>\n<p>&lt;head &lt;?php do_action( &#8216;add_head_attributes&#8217; ); ?&gt;&gt;<\/p>\n<p>Being a HTML ignoramus, I would appreciate confirmation as to <strong>exactly<\/strong> where to insert the code in header.php of Elucidate (which I use as a Child). TIA<\/p>\n<pre><code>&lt;?php\n\/**\n * The Header for our theme.\n *\n * Displays all of the &lt;head&gt; section and everything up till &lt;div id=&quot;content&quot;&gt;\n *\n * @package Elucidate\n *\/\n?&gt;&lt;!DOCTYPE html&gt;\n&lt;html &lt;?php language_attributes(); ?&gt;&gt;\n&lt;head&gt;\n&lt;meta charset=&quot;&lt;?php bloginfo( &#039;charset&#039; ); ?&gt;&quot;&gt;\n&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n&lt;title&gt;&lt;?php wp_title( &#039;|&#039;, true, &#039;right&#039; ); ?&gt;&lt;\/title&gt;\n&lt;link rel=&quot;profile&quot; href=&quot;http:\/\/gmpg.org\/xfn\/11&quot;&gt;\n&lt;link rel=&quot;pingback&quot; href=&quot;&lt;?php bloginfo( &#039;pingback_url&#039; ); ?&gt;&quot;&gt;\n\n&lt;?php wp_head(); ?&gt;\n&lt;\/head&gt;\n\n&lt;body &lt;?php body_class(); ?&gt;&gt;\n&lt;div id=&quot;page&quot; class=&quot;hfeed site&quot;&gt;\n\t&lt;?php do_action( &#039;before&#039; ); ?&gt;\n\t&lt;div class=&quot;screen-reader-text skip-link&quot;&gt;&lt;a href=&quot;#content&quot;&gt;&lt;?php _e( &#039;Skip to content&#039;, &#039;elucidate&#039; ); ?&gt;&lt;\/a&gt;&lt;\/div&gt;\n\t&lt;header id=&quot;masthead&quot; class=&quot;site-header&quot; role=&quot;banner&quot;&gt;\n\t\t&lt;div class=&quot;site-branding&quot;&gt;\n\t\t\t&lt;h1 class=&quot;site-title&quot;&gt;&lt;a href=&quot;&lt;?php echo esc_url( home_url( &#039;\/&#039; ) ); ?&gt;&quot; rel=&quot;home&quot;&gt;&lt;?php bloginfo( &#039;name&#039; ); ?&gt;&lt;\/a&gt;&lt;\/h1&gt;\n\t\t\t&lt;h2 class=&quot;site-description&quot;&gt;&lt;?php bloginfo( &#039;description&#039; ); ?&gt;&lt;\/h2&gt;\n\t\t\t\n\t\t\t&lt;?php if ( get_header_image() ) { ?&gt;\n\t\t\t\t&lt;a href=&quot;&lt;?php echo esc_url( home_url( &#039;\/&#039; ) ); ?&gt;&quot; rel=&quot;home&quot;&gt;\n\t\t\t\t\t&lt;img src=&quot;&lt;?php header_image(); ?&gt;&quot; height=&quot;&lt;?php echo get_custom_header()-&gt;height; ?&gt;&quot; width=&quot;&lt;?php echo get_custom_header()-&gt;width; ?&gt;&quot; alt=&quot;&quot; \/&gt;\n\t\t\t\t&lt;\/a&gt;\n\t\t\t&lt;?php } ?&gt;\n\t\t&lt;\/div&gt;\n\n\t\t&lt;nav id=&quot;site-navigation&quot; class=&quot;main-navigation&quot; role=&quot;navigation&quot;&gt;\n\t\t\t&lt;button class=&quot;menu-toggle&quot; aria-controls=&quot;menu&quot; aria-expanded=&quot;false&quot;&gt;&lt;?php _e( &#039;Menu&#039;, &#039;_s&#039; ); ?&gt;&lt;\/button&gt;\n\t\t\t&lt;?php wp_nav_menu( array( &#039;theme_location&#039; =&gt; &#039;primary&#039; ) ); ?&gt;\n\t\t&lt;\/nav&gt;&lt;!-- #site-navigation --&gt;\n\t&lt;\/header&gt;&lt;!-- #masthead --&gt;\n\n\t&lt;div id=&quot;content&quot; class=&quot;site-content&quot;&gt;\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-9672990","topic","type-topic","status-publish","hentry","topic-tag-header-php"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9672990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9672990\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9672990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}