Beispiel #1
0
/**
 * Inserts the schema to the frontend
 * @return none
 * @since 1.0
 */
function cuttz_set_schema()
{
    if (!current_theme_supports('cuttz-schema')) {
        return;
    }
    if (!is_single() && !is_page()) {
        return;
    }
    global $post;
    $schema = get_post_meta($post->ID, '_cuttz_schema', 1);
    if ($schema == 'none') {
        return;
    }
    if (!empty($schema)) {
        $schema = cuttz_get_schema($schema);
        $context = $schema['context'];
        add_filter('genesis_attr_' . $context, 'cuttz_attributes_node');
    }
}
Beispiel #2
0
/**
 * Inserts the schema to the frontend
 * @return none
 * @since 1.0
 */
function cuttz_attributes_node($attributes)
{
    global $post;
    $saved_schema = get_post_meta($post->ID, '_cuttz_schema', 1);
    $schema = cuttz_get_schema($saved_schema);
    $attributes['itemtype'] = $schema['itemtype'];
    $attributes['itemscope'] = 'itemscope';
    return $attributes;
}