Permalink
Browse files

schema solidified more

Signed-off-by: Norik Davtian <norik@bigemployee.com>
  • Loading branch information...
NorikDavtian committed Apr 25, 2014
1 parent 87cad6f commit 3670d9a2d1b3a41dc9a00b56649a46c489a12481
Showing with 27 additions and 23 deletions.
  1. +2 −2 author.php
  2. +1 −1 comments.php
  3. +1 −1 content-page.php
  4. +3 −3 content-profile.php
  5. +1 −1 content-team.php
  6. +4 −4 content.php
  7. +5 −2 header-layout.php
  8. +1 −1 image.php
  9. +8 −7 inc/schema.php
  10. +1 −1 inc/template-tags.php
View
@@ -10,7 +10,7 @@
?>
<?php if (have_posts()) : ?>
<header class="archive-header">
<h1 class="archive-title">
<h1 class="archive-title" <?php schema('name'); ?>>
<?php
/*
* Queue the first post, that way we know what author
@@ -24,7 +24,7 @@
?>
</h1>
<?php if (get_the_author_meta('description')) : ?>
<div class="author-description"><?php the_author_meta('description'); ?></div>
<div class="author-description" <?php schema('description'); ?>><?php the_author_meta('description'); ?></div>
<?php endif; ?>
</header><!-- .archive-header -->
<?php
View
@@ -13,7 +13,7 @@
return;
}
?>
<div id="comments" class="comments-area" <?php schema('', 'Comment'); ?>>
<div id="comments" class="comments-area" <?php schema(false, 'Comment'); ?>>
<?php if (have_comments()) : ?>
<h2 class="comments-title">
<?php
View
@@ -8,7 +8,7 @@
<?php
// Page thumbnail and title.
bigblank_post_thumbnail();
the_title('<header class="entry-header"><h1 class="entry-title" ' . schema('name') . '>', '</h1></header><!-- .entry-header -->');
the_title('<header class="entry-header"><h1 class="entry-title" ' . schema('name', false, false) . '>', '</h1></header><!-- .entry-header -->');
?>
<div class="entry-content" <?php schema('mainContentOfPage'); ?>>
<?php
View
@@ -4,22 +4,22 @@
*
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('profile'); ?> <?php schema('', 'Person'); ?>>
<article id="post-<?php the_ID(); ?>" <?php post_class('profile'); ?> <?php schema(false, 'Person'); ?>>
<header class="entry-header">
<?php if (has_post_thumbnail()): ?>
<div id="featured-header">
<?php the_post_thumbnail('post-thumbnail', 'itemprop=image'); ?>
</div>
<?php endif; ?>
<?php the_title('<h1 class="entry-title" ' . schema('name') . '>', '</h1>'); ?>
<?php the_title('<h1 class="entry-title" ' . schema('name', false, false) . '>', '</h1>'); ?>
<?php $title = get_post_meta(get_the_ID(), 'title', true); ?>
<?php $facebook = get_post_meta(get_the_ID(), 'facebook', true); ?>
<?php $twitter = get_post_meta(get_the_ID(), 'twitter', true); ?>
<?php $google_plus = get_post_meta(get_the_ID(), 'google+', true); ?>
<?php $instagram = get_post_meta(get_the_ID(), 'instagram', true); ?>
<?php $youtube = get_post_meta(get_the_ID(), 'youtube', true); ?>
<?php $pinterest = get_post_meta(get_the_ID(), 'pinterest', true); ?>
<?php bigblank_print($title, '<h2 ' . schema('jobTitle') . '><em>(', ')</em></h2>'); ?>
<?php bigblank_print($title, '<h2 ' . schema('jobTitle', false, false) . '><em>(', ')</em></h2>'); ?>
<?php bigblank_print($facebook, '<a href="', '"><i class="fa fa-facebook-square"></i></a>'); ?>
<?php bigblank_print($twitter, '<a href="', '"><i class="fa fa-twitter-square"></i></a>'); ?>
<?php bigblank_print($google_plus, '<a href="', '"><i class="fa fa-google-plus-square"></i></a>'); ?>
View
@@ -8,7 +8,7 @@
<?php
// Page thumbnail and title.
bigblank_post_thumbnail();
the_title('<header class="entry-header"><h1 class="entry-title" ' . schema('name') . '>', '</h1></header><!-- .entry-header -->');
the_title('<header class="entry-header"><h1 class="entry-title" ' . schema('name', false, false) . '>', '</h1></header><!-- .entry-header -->');
?>
<div class="entry-content" <?php schema('mainContentOfPage'); ?>>
<?php
View
@@ -11,9 +11,9 @@
<header class="entry-header">
<?php
if (is_single()) :
the_title('<h1 class="entry-title" ' . schema('name') . '>', '</h1>');
the_title('<h1 class="entry-title" ' . schema('name', false, false) . '>', '</h1>');
else :
the_title('<h1 class="entry-title" ' . schema('name') . '><a href="' . esc_url(get_permalink()) . '" rel="bookmark" ' . schema('url') . '>', '</a></h1>');
the_title('<h1 class="entry-title" ' . schema('name', false, false) . '><a href="' . esc_url(get_permalink()) . '" rel="bookmark" ' . schema('url', false, false) . '>', '</a></h1>');
endif;
?>
<div class="entry-meta">
@@ -65,8 +65,8 @@
<?php echo get_avatar(get_the_author_meta('user_email'), apply_filters('gravatar', 128)); ?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2 <?php schema('name'); ?>><?php printf(__('About %s', 'betheme'), get_the_author()); ?></h2>
<p><?php the_author_meta('description'); ?></p>
<h2 <?php schema('name'); ?> <?php schema('name'); ?>><?php printf(__('About %s', 'betheme'), get_the_author()); ?></h2>
<p <?php schema('description'); ?>><?php the_author_meta('description'); ?></p>
<a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" class="author-link" rel="author" <?php schema('url'); ?>>
<?php printf(__('View all posts by %s <span class="meta-nav">&rarr;</span>', 'betheme'), get_the_author()); ?>
</a><!-- .author-link -->
View
@@ -5,8 +5,11 @@
*/
$layout = bigblank_get_layout();
if (is_home() || is_archive()) {
$schema = schema('', 'Blog');
$schema = schema(false, 'Blog', false);
if (is_author()) {
$schema = schema(false, 'ProfilePage', false);
}
}
?>
<div id="content" class="site-content <?php echo $layout ?> <?php $schema ?>">
<div id="content" class="site-content <?php echo $layout; ?> <?php $schema; ?>">
<div id="main" role="main">
View
@@ -23,7 +23,7 @@
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content" <?php schema('mainContentOfPage'); ?>>
<div class="entry-attachment" <?php schema('', 'ImageObject'); ?>>
<div class="entry-attachment" <?php schema(false, 'ImageObject'); ?>>
<div class="attachment">
<?php bigblank_the_attached_image(); ?>
</div><!-- .attachment -->
View
@@ -34,15 +34,11 @@ function itemtype() {
if (is_page('about')) { /* Change the slug to your about page */
$itemtype = 'AboutPage';
}
} elseif (is_home() || is_archive()) {
$itemtype = 'BlogPosting';
} elseif (is_search()) {
$itemtype = 'search';
} elseif (is_author()) {
$itemtype = 'ProfilePage';
} elseif (is_search()) {
$itemtype = 'SearchResultsPage';
} elseif (is_single()) {
} elseif (is_single() || is_home() || is_archive()) {
$itemtype = 'BlogPosting';
} else {
$itemtype = 'Thing';
@@ -56,7 +52,7 @@ function itemtype() {
* @param string $itemprop Item Property in camelCase separated with a space.
* @param string $itemtype Item Type in camelCase separated with a space.
*/
function schema($itemprop = '', $itemtype = '') {
function schema($itemprop = '', $itemtype = '', $echo = true) {
if ($itemprop && $itemtype) {
$schema = itemprop($itemprop) . ' itemscope="" itemtype="http://schema.org/' . $itemtype . '"';
} elseif (empty($itemprop)) {
@@ -67,5 +63,10 @@ function schema($itemprop = '', $itemtype = '') {
} else {
$schema = itemprop($itemprop);
}
echo $schema;
if ($echo) {
echo $schema;
} else {
return $schema;
}
}
View
@@ -195,7 +195,7 @@ function bigblank_post_nav() {
*/
function bigblank_posted_on() {
// Set up and print post meta information.
printf('<a href="%1$s" class="entry-date" rel="bookmark" ' . schema('url') . '><time class="published" datetime="%2$s" ' . schema('datePublished') . '>%3$s</time></a> <a class="author vcard url fn n" href="%4$s" rel="author" ' . schema('author') . '>%5$s</a>', esc_url(get_permalink()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
printf('<a href="%1$s" class="entry-date" rel="bookmark" ' . schema('url', false, false) . '><time class="published" datetime="%2$s" ' . schema('datePublished', false, false) . '>%3$s</time></a> <a class="author vcard url fn n" href="%4$s" rel="author" ' . schema('author', false, false) . '>%5$s</a>', esc_url(get_permalink()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
}
endif;

0 comments on commit 3670d9a

Please sign in to comment.