Skip to content

Commit

Permalink
Cleaned up the code significantly. Added additional post formats, and…
Browse files Browse the repository at this point in the history
… we are almost there for Wordpress Theme Review.
  • Loading branch information
kylethielk committed Jan 21, 2013
1 parent 02fa215 commit 83e94d1
Show file tree
Hide file tree
Showing 22 changed files with 1,253 additions and 1,436 deletions.
36 changes: 36 additions & 0 deletions 404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* The template for displaying 404 pages (Not Found).
**/

get_header();
?>

<div id="wrap">
<div id="left-column">
<?php get_sidebar(); ?>
</div>
<div id="right-column">

<div class="type-post">

<header>
<h2>Woops, an error occurred.</h2>
</header>

<div class="post-text">
<p>Unfortunately the content you are looking for is not here. Sorry about that! Go to
<a href="<?php echo esc_url(home_url('/')); ?>"
title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>"
rel="home">
<?php bloginfo('name'); ?>
</a>.
</p>
</div>

</div>

</div>
</div>

<?php get_footer(); ?>
56 changes: 56 additions & 0 deletions archive.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* The template for displaying Archive pages.
* Also see tag.php,author.php and category.php for those
* specific archive pages.
*/

get_header(); ?>

<div id="wrap">
<!-- Post Loop -->

<div id="left-column">
<?php get_sidebar(); ?>
</div>

<div id="right-column">

<?php if (have_posts()) : ?>
<header>
<h1 class="archive-title">
<?php
if (is_day()) :
printf(__('Daily Archives: %s', 'rebar'), '<span>' . get_the_date() . '</span>');
elseif (is_month()) :
printf(__('Monthly Archives: %s', 'rebar'), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', 'rebar')) . '</span>');
elseif (is_year()) :
printf(__('Yearly Archives: %s', 'rebar'), '<span>' . get_the_date(_x('Y', 'yearly archives date format', 'rebar')) . '</span>');
else :
_e('Archives', 'rebar');
endif;
?>
</h1>
</header><!-- .archive-header -->

<?php
/* Start the Loop */
while (have_posts()) : the_post();

get_template_part('content', 'post');

endwhile;

?>

<?php else : ?>
<?php get_template_part('content', 'noresults'); ?>
<?php endif; ?>

</div>
</div>




<?php get_footer(); ?>
63 changes: 63 additions & 0 deletions author.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/**
* The template for displaying Author Archive pages.
*/

get_header(); ?>

<div id="wrap">
<!-- Post Loop -->

<div id="left-column">
<?php get_sidebar(); ?>
</div>

<div id="right-column">


<?php if (have_posts()) : ?>

<?php
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
the_post();
?>

<header>
<h1 class="archive-title">
<?php printf(translate
('Author Archives: %s', 'rebar'),
'<span class="vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta("ID"))) . '" title="' . esc_attr(get_the_author()) . '" rel="me">' . get_the_author() . '</a></span>');
?>
</h1>
</header><!-- .archive-header -->

<?php
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
?>


<?php /* Start the Loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('content', 'post'); ?>
<?php endwhile; ?>

<?php rebar_content_nav(); ?>

<?php else : ?>
<?php get_template_part('content', 'noresults'); ?>
<?php endif; ?>

</div>
<!-- #content -->
</div><!-- #primary -->

<?php get_footer(); ?>
44 changes: 44 additions & 0 deletions category.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php get_header(); ?>

<div id="wrap">
<!-- Post Loop -->

<div id="left-column">
<?php get_sidebar(); ?>
</div>

<div id="right-column">

<?php if (have_posts()) : ?>
<header>
<h1 class="archive-title">
<?php printf(__('Category Archives: %s', 'rebar'), '<span>' . single_cat_title('', false) . '</span>'); ?>
</h1>

<?php if (category_description()) : // Show an optional category description ?>
<div class="archive-meta">
<?php echo category_description(); ?>
</div>
<?php endif; ?>

</header>
<?php
/* Start the Loop */
while (have_posts()) : the_post();

get_template_part('content', 'post');

endwhile;

rebar_content_nav();
?>

<?php else : ?>
<?php get_template_part('content', 'noresults'); ?>
<?php endif; ?>

</div>
<!-- #content -->
</div><!-- #primary -->

<?php get_footer(); ?>
54 changes: 26 additions & 28 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,57 @@
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to twentytwelve_comment() which is
* located in the functions.php file.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/

/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() )
if (post_password_required())
{
return;
}
?>

<div id="comments">

<?php // You can start editing here -- including this comment! ?>

<?php if ( have_comments() ) : ?>
<?php if (have_comments()) : ?>
<h2 class="comments-title">
<?php
printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'rebar' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
printf(_n('One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'rebar'),
number_format_i18n(get_comments_number()), '<span>' . (get_the_title() == '' ? 'Untitled' : get_the_title()) . '</span>');
?>
</h2>

<ol class="commentlist">
<?php wp_list_comments( array( 'callback' => 'rebar_comment', 'style' => 'ol' ) ); ?>
<ol class="comment-list">
<?php wp_list_comments(array('callback' => 'rebar_comment', 'style' => 'ol')); ?>
</ol><!-- .commentlist -->

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="navigation" role="navigation">
<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'rebar' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'rebar' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'rebar' ) ); ?></div>
<?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="comment-page-links" role="navigation">
<div class="bottom-left"><?php previous_comments_link(__('&larr; Older Comments', 'rebar')); ?></div>
<div class="bottom-right"><?php next_comments_link(__('Newer Comments &rarr;', 'rebar')); ?></div>
</nav>
<?php endif; // check for comment navigation ?>
<?php endif; ?>



<?php endif; // have_comments() ?>

<?php
/* If there are no comments and comments are closed, let's leave a note.
* But we only want the note on posts and pages that had comments in the first place.
*/
if ( ! comments_open() && get_comments_number() ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , 'rebar' ); ?></p>
if (!comments_open()) : ?>
<p class="nocomments-box">Comments are closed.</p>
<?php endif; ?>

<?php endif; // have_comments() ?>

<?php comment_form(); ?>
<?php if ('open' == $post->comment_status): ?>
<div class="comment-box"
style="<?php echo (get_comments_number() == 0 ? "margin: 5px 0 0 8px;" : "margin-left: 95px"); ?>">
<?php comment_form(array("comment_notes_after" => '')); ?>
</div>
<?php endif; ?>

</div><!-- #comments .comments-area -->
</div>
7 changes: 7 additions & 0 deletions content-noresults.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="type-post">
<br/><br/>
<div class="post-text">
Sorry, but nothing was found for your query.
</div>
</div>
36 changes: 36 additions & 0 deletions content-page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<article>
<div <?php post_class(); ?>>

<?php if (has_post_thumbnail()): ?>
<?php the_post_thumbnail(); ?>
<?php endif; ?>

<h2>
<?php echo (the_title('', '', false) == '' ? 'Read More' : the_title('', '', false)); ?>
</h2>

<?php if (is_archive() || is_search()) : // Only display excerpts for archives and search. ?>
<div class="post-text">
<?php the_excerpt(); ?>
</div>
<?php else : ?>

<div class="post-text">
<?php the_content('Read More'); ?>
</div>

<div class="post-text clearfix">
<?php edit_post_link('Edit Page'); ?>
</div>

<div class="link-pages">
<?php wp_link_pages(); ?>
</div>

<?php endif; ?>

<?php rebar_post_meta(); ?>


</div>
</article>
32 changes: 32 additions & 0 deletions content-status.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div class="status-wrapper">

<div class="status-author-wrapper">
<div class="avatar-box ">
<a href="<?php the_permalink(); ?>">
<?php echo get_avatar($post->post_author, 60);
?>
</a>
</div>

</div>

<article <?php post_class("status-box"); ?>>

<div class="status-details">
Posted by
<?php echo '<span class="bypostauthor">' . get_the_author_link() . '</span>'; ?>
on

<span><?php echo get_the_date(); ?></span>
(<a href="<?php the_permalink(); ?>">Reply</a>)

</div>

<div class="status-text">
<?php the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'rebar')); ?>
</div>

<?php rebar_post_meta(); ?>

</article>
</div>
Loading

0 comments on commit 83e94d1

Please sign in to comment.