Permalink
Browse files

drying layout scaffold

Signed-off-by: Norik Davtian <norik@bigemployee.com>
  • Loading branch information...
NorikDavtian committed Mar 2, 2014
1 parent d1f4786 commit f5aca58fec7d4850bc43a4fff98dd227049363ff
Showing with 287 additions and 302 deletions.
  1. +9 −12 404.php
  2. +2 −5 archive.php
  3. +41 −44 author.php
  4. +28 −31 category.php
  5. +12 −0 footer-layout.php
  6. +22 −0 header-layout.php
  7. +45 −48 image.php
  8. +21 −25 index.php
  9. +21 −26 page-templates/contributors.php
  10. +13 −24 page.php
  11. +23 −26 search.php
  12. +22 −30 single.php
  13. +28 −31 tag.php
View
21 404.php
@@ -4,18 +4,15 @@
*
*/
get_header();
get_header('layout');
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<header class="page-header">
<h1 class="page-title"><?php _e('Not Found', 'bigblank'); ?></h1>
</header>
<div class="page-content">
<p><?php _e('It looks like nothing was found at this location. Maybe try a search?', 'bigblank'); ?></p>
<?php get_search_form(); ?>
</div><!-- .page-content -->
</div><!-- #content -->
</div><!-- #primary -->
<header class="page-header">
<h1 class="page-title"><?php _e('Not Found', 'bigblank'); ?></h1>
</header>
<div class="page-content">
<p><?php _e('It looks like nothing was found at this location. Maybe try a search?', 'bigblank'); ?></p>
<?php get_search_form(); ?>
</div><!-- .page-content -->
<?php
get_sidebar();
get_footer('layout');
get_footer();
View
@@ -14,9 +14,8 @@
*
*/
get_header();
get_header('layout');
?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php if (have_posts()) : ?>
<header class="page-header">
<h1 class="page-title">
@@ -50,8 +49,6 @@
get_template_part('content', 'none');
endif;
?>
</div><!-- #content -->
</section><!-- #primary -->
<?php
get_sidebar();
get_footer('layout');
get_footer();
View
@@ -6,53 +6,50 @@
*
*/
get_header();
get_header('layout');
?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php if (have_posts()) : ?>
<header class="archive-header">
<h1 class="archive-title">
<?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();
printf(__('All posts by %s', 'bigblank'), get_the_author());
?>
</h1>
<?php if (get_the_author_meta('description')) : ?>
<div class="author-description"><?php the_author_meta('description'); ?></div>
<?php endif; ?>
</header><!-- .archive-header -->
<?php if (have_posts()) : ?>
<header class="archive-header">
<h1 class="archive-title">
<?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.
* 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().
*/
rewind_posts();
// Start the Loop.
while (have_posts()) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part('content', get_post_format());
endwhile;
// Previous/next page navigation.
bigblank_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part('content', 'none');
endif;
?>
</div><!-- #content -->
</section><!-- #primary -->
the_post();
printf(__('All posts by %s', 'bigblank'), get_the_author());
?>
</h1>
<?php if (get_the_author_meta('description')) : ?>
<div class="author-description"><?php the_author_meta('description'); ?></div>
<?php endif; ?>
</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();
// Start the Loop.
while (have_posts()) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part('content', get_post_format());
endwhile;
// Previous/next page navigation.
bigblank_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part('content', 'none');
endif;
?>
<?php
get_sidebar();
get_footer('layout');
get_footer();
View
@@ -6,39 +6,36 @@
*
*/
get_header();
get_header('layout');
?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php if (have_posts()) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf(__('Category Archives: %s', 'bigblank'), single_cat_title('', false)); ?></h1>
<?php
// Show an optional term description.
$term_description = term_description();
if (!empty($term_description)) :
printf('<div class="taxonomy-description">%s</div>', $term_description);
endif;
?>
</header><!-- .archive-header -->
<?php
// Start the Loop.
while (have_posts()) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part('content', get_post_format());
endwhile;
// Previous/next page navigation.
bigblank_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part('content', 'none');
<?php if (have_posts()) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf(__('Category Archives: %s', 'bigblank'), single_cat_title('', false)); ?></h1>
<?php
// Show an optional term description.
$term_description = term_description();
if (!empty($term_description)) :
printf('<div class="taxonomy-description">%s</div>', $term_description);
endif;
?>
</div><!-- #content -->
</section><!-- #primary -->
</header><!-- .archive-header -->
<?php
// Start the Loop.
while (have_posts()) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part('content', get_post_format());
endwhile;
// Previous/next page navigation.
bigblank_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part('content', 'none');
endif;
?>
<?php
get_sidebar();
get_footer('layout');
get_footer();
View
@@ -0,0 +1,12 @@
<?php
/**
* Closing our content scaffold and checking to see if we should include sidebar
* Always call get_header('layout'); to open tags closed here.
*
*/
?>
</div><!-- #main -->
<?php if ($layout == 'content-sidebar' || $layout == 'sidebar-content'): ?>
<?php get_sidebar(); ?>
<?php endif; ?>
</div><!-- #content -->
View
@@ -0,0 +1,22 @@
<?php
/**
* Adding layout class to our main content
* Always call get_footer('layout'); to close tags opened here.
* @todo create a function to overwrite comments open
* @todo create a function to get the layout
* @link https://codex.wordpress.org/Function_Reference/comments_open#Examples
*/
$layout = get_post_meta(get_the_ID(), 'bigblank_post_layout', true);
$options = bigblank_get_theme_options();
if (!$layout) {
$layout = $options['theme_layout'];
}
if(is_page()){
$comments = $options['page_comments'];
}
if(is_single()){
$comments = $options['post_comments'];
}
?>
<div id="content" class="site-content <?php echo $layout; ?>">
<div id="main" role="main">
View
@@ -6,55 +6,52 @@
// Retrieve attachment metadata.
$metadata = wp_get_attachment_metadata();
get_header();
get_header('layout');
?>
<section id="primary" class="content-area image-attachment">
<div id="content" class="site-content" role="main">
<?php
// Start the Loop.
while (have_posts()) : the_post();
<?php
// Start the Loop.
while (have_posts()) : the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title('<h1 class="entry-title">', '</h1>'); ?>
<div class="entry-meta">
<span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr(get_the_date('c')); ?>"><?php echo esc_html(get_the_date()); ?></time></span>
<span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
<span class="parent-post-link"><a href="<?php echo get_permalink($post->post_parent); ?>" rel="gallery"><?php echo get_the_title($post->post_parent); ?></a></span>
<?php edit_post_link(__('Edit', 'bigblank'), '<span class="edit-link">', '</span>'); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<div class="attachment">
<?php bigblank_the_attached_image(); ?>
</div><!-- .attachment -->
<?php if (has_excerpt()) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div><!-- .entry-caption -->
<?php endif; ?>
</div><!-- .entry-attachment -->
<?php
the_content();
wp_link_pages(array(
'before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'bigblank') . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
));
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title('<h1 class="entry-title">', '</h1>'); ?>
<div class="entry-meta">
<span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr(get_the_date('c')); ?>"><?php echo esc_html(get_the_date()); ?></time></span>
<span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
<span class="parent-post-link"><a href="<?php echo get_permalink($post->post_parent); ?>" rel="gallery"><?php echo get_the_title($post->post_parent); ?></a></span>
<?php edit_post_link(__('Edit', 'bigblank'), '<span class="edit-link">', '</span>'); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<div class="attachment">
<?php bigblank_the_attached_image(); ?>
</div><!-- .attachment -->
<?php if (has_excerpt()) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div><!-- .entry-caption -->
<?php endif; ?>
</div><!-- .entry-attachment -->
<?php
the_content();
wp_link_pages(array(
'before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'bigblank') . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
));
?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
<nav id="image-navigation" class="navigation image-navigation">
<div class="nav-links">
<?php previous_image_link(false, '<div class="previous-image">' . __('Previous Image', 'bigblank') . '</div>'); ?>
<?php next_image_link(false, '<div class="next-image">' . __('Next Image', 'bigblank') . '</div>'); ?>
</div><!-- .nav-links -->
</nav><!-- #image-navigation -->
<?php comments_template(); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</section><!-- #primary -->
</div><!-- .entry-content -->
</article><!-- #post-## -->
<nav id="image-navigation" class="navigation image-navigation">
<div class="nav-links">
<?php previous_image_link(false, '<div class="previous-image">' . __('Previous Image', 'bigblank') . '</div>'); ?>
<?php next_image_link(false, '<div class="next-image">' . __('Next Image', 'bigblank') . '</div>'); ?>
</div><!-- .nav-links -->
</nav><!-- #image-navigation -->
<?php comments_template(); ?>
<?php endwhile; // end of the loop. ?>
<?php
get_sidebar();
get_footer('layout');
get_footer();
Oops, something went wrong.

0 comments on commit f5aca58

Please sign in to comment.