Skip to content

Add schema.org Article markup to c4lj theme #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions single.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<?php get_header(); ?>
<?php get_sidebar(); ?>

<div id="content">
<div id="content" vocab="http://schema.org/">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="article" id="post-<?php the_ID(); ?>">
<div class="article" id="post-<?php the_ID(); ?>" typeof="Article">
<p id="issueDesignation"><?php foreach( (get_the_category()) as $cat ) {
$parent = get_category($cat->category_parent);
if ( $parent && $parent->category_nicename == "issues" ) { // category should be child of Issues
echo '<a href="'. get_category_link($cat->cat_ID).'">'.$cat->cat_name.", ".$cat->category_description."</a>";
break; // only do this once. Something's wrong if it's in multiple issues
}
}?></p>
<h1 class="articletitle"><?php the_title(); ?></h1>
<div class="abstract">
<h1 class="articletitle" property="name"><?php the_title(); ?></h1>
<p class="author"><?php the_author(); ?></p>
<div class="abstract" property="description">
<?php the_excerpt(); ?>
</div>
<div class="entry">
<div class="entry" property="articleBody">
<?php the_content('<p class="readmore">Read this article...</p>'); ?>
</div>
<?php the_tags( '<p class="tags">Tags: ', ', ', '</p>'); ?>
<?php the_tags( '<p class="tags" property="keywords">Tags: ', ', ', '</p>'); ?>
<?php edit_post_link('Edit this article', '<p class="editlink">', '</p>'); ?>
</div>
<?php comments_template(); ?>
Expand All @@ -27,4 +28,4 @@
<?php endif; ?>
</div>

<?php get_footer(); ?>
<?php get_footer(); ?>