public function entry_attributes($attributes)
 {
     if (!is_main_query() && !genesis_is_blog_template()) {
         return $attributes;
     }
     $schema_type = genesis_get_custom_field('genesis_schema_type');
     if (!$schema_type) {
         return $attributes;
     }
     $attributes['itemscope'] = true;
     $attributes['itemtype'] = 'http://schema.org/' . $schema_type;
     return $attributes;
 }
示例#2
0
/**
 * Add attributes for entry content element.
 *
 * @since 2.0.0
 *
 * @param array $attributes Existing attributes for entry content element.
 * @return array Amended attributes for entry content element.
 */
function genesis_attributes_entry_content($attributes)
{
    if (!is_main_query() && !genesis_is_blog_template()) {
        return $attributes;
    }
    $attributes['itemprop'] = 'text';
    return $attributes;
}
示例#3
0
文件: markup.php 项目: sello-rex/ased
/**
 * Add attributes for entry element.
 *
 * @since 2.0.0
 *
 * @param array $attributes Existing attributes.
 *
 * @return array Amended attributes.
 */
function genesis_attributes_entry($attributes)
{
    $attributes['class'] = join(' ', get_post_class());
    if (!is_main_query() && !genesis_is_blog_template()) {
        return $attributes;
    }
    $attributes['itemscope'] = true;
    $attributes['itemtype'] = 'http://schema.org/CreativeWork';
    return $attributes;
}
示例#4
0
/**
 * Replace `close` html5 markup with xhtml equivalent.
 *
 * @since 2.4.0
 *
 * @param string $close Close markup.
 *
 * @param array $args Markup arguments.
 *
 * @return string Xhtml close markup.
 */
function genesis_markup_close_xhtml($close, $args)
{
    if (empty($args['context'])) {
        return $close;
    }
    if (substr($args['context'], 0, 4) == 'nav-') {
        return '</div>';
    }
    if ('entry-content' == $args['context'] && !is_main_query() && !genesis_is_blog_template()) {
        return '';
    }
    switch ($args['context']) {
        case 'entry':
        case 'content-sidebar-wrap':
        case 'content':
        case 'entry-404':
        case 'entry-meta-after-content':
        case 'entry-meta-before-content':
        case 'sidebar-primary':
        case 'sidebar-secondary':
        case 'site-footer':
        case 'site-header':
            $close = '</div>';
            break;
        case 'entry-header':
        case 'header-nav':
        case 'semantic-description':
        case 'semantic-headings':
        case 'widget-entry-content':
            $close = '';
            break;
        case 'entry-pagination':
            $close = '</p>';
            break;
        case 'entry-title':
        case 'site-description':
        case 'site-title':
            $wrap = isset($args['params']) && !empty($args['params']['wrap']) ? $args['params']['wrap'] : '';
            $close = "</{$wrap}>";
            break;
        case 'widget-entry-title':
            $close = genesis_a11y('headings') ? '</h4>' : '</h2>';
            break;
        case 'widget-wrap':
            $close = '</div></div>' . "\n";
            break;
    }
    return $close;
}
示例#5
0
/**
 * Add attributes for entry element.
 *
 * @since 2.0.0
 *
 * @param array $attributes Existing attributes.
 *
 * @return array Amended attributes.
 */
function genesis_attributes_entry($attributes)
{
    $attributes['class'] = join(' ', get_post_class());
    if (!is_main_query() && !genesis_is_blog_template()) {
        return $attributes;
    }
    if (!is_page_template('page_blog.php')) {
        $attributes['itemscope'] = true;
        $attributes['itemtype'] = 'http://schema.org/CreativeWork';
    }
    //* Blog posts microdata
    if ('post' === get_post_type()) {
        $attributes['itemscope'] = true;
        $attributes['itemtype'] = 'http://schema.org/BlogPosting';
        //* If not search results page
        if (!is_search()) {
            $attributes['itemprop'] = 'blogPost';
        }
    }
    return $attributes;
}