Here's a quick answer to the question:
How do I add itemscope="http://schema.org/WebSite" to the <head> element in a Genesis Framework powered theme?
Add the following to your theme's functions.php:
The Technical Explanation
If you are more technically inclined and want to understand why this code works, here's the break down. The <head> element in a Genesis Framework powered theme is generated from the framework's /lib/structure/header.php file. The following code contains lines 14 through 68 of that code:
For HTML5 based themes, the Genesis framework adds a neat little function named genesis_attr() to the head element's output. The genesis_attr() function allows a developer to build a list of attributes into a string and apply a contextual filter to that string. The function takes two parameters, $context and $attributes. You can see the context in the highlighted line above ('head'). The filter used in the code is created by appending the context to the function name. In this case, the contextual filter is genesis_attr_head. The $attributes are passed through the filter as an array.
What i’m looking for to edit my theme. Thanks Victor and Genesis team 🙂
Hi Luca,
As an FYI, please don’t confuse the help I provide as a community volunteer with being part of the Genesis team. We are independent contractors and have no affiliation with Studio Press or the Genesis team. Other than the help we provide on the Studio Press forum and WordPress Genesis Facebook page, we expect to receive compensation for our services as paid professionals. If you have a budget and would like to discuss your project requirements, please start by filling out our Project Inquiry form.