Restructure theme, use autoloader

This commit is contained in:
QWp6t
2015-12-18 16:41:37 -08:00
committed by Ben Word
parent 8d7bcee4c4
commit 9eaffa3a2d
47 changed files with 771 additions and 393 deletions

View File

@@ -0,0 +1,36 @@
<?php
if (post_password_required()) {
return;
}
?>
<section id="comments" class="comments">
<?php if (have_comments()) : ?>
<h2><?php printf(_nx('One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>'); ?></h2>
<ol class="comment-list">
<?php wp_list_comments(['style' => 'ol', 'short_ping' => true]); ?>
</ol>
<?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?>
<nav>
<ul class="pager">
<?php if (get_previous_comments_link()) : ?>
<li class="previous"><?php previous_comments_link(__('&larr; Older comments', 'sage')); ?></li>
<?php endif; ?>
<?php if (get_next_comments_link()) : ?>
<li class="next"><?php next_comments_link(__('Newer comments &rarr;', 'sage')); ?></li>
<?php endif; ?>
</ul>
</nav>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php if (!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments')) : ?>
<div class="alert alert-warning">
<?php _e('Comments are closed.', 'sage'); ?>
</div>
<?php endif; ?>
<?php comment_form(); ?>
</section>

View File

@@ -0,0 +1,2 @@
<?php the_content(); ?>
<?php wp_link_pages(['before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']); ?>

View File

@@ -0,0 +1,9 @@
<article <?php post_class(); ?>>
<header>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php if (get_post_type() === 'post') { App\template_part('partials/entry-meta'); } ?>
</header>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
</article>

View File

@@ -0,0 +1,15 @@
<?php while (have_posts()) : the_post(); ?>
<article <?php post_class(); ?>>
<header>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php App\template_part('partials/entry-meta'); ?>
</header>
<div class="entry-content">
<?php the_content(); ?>
</div>
<footer>
<?php wp_link_pages(['before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']); ?>
</footer>
<?php comments_template('/templates/partials/comments.php'); ?>
</article>
<?php endwhile; ?>

View File

@@ -0,0 +1,9 @@
<article <?php post_class(); ?>>
<header>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php App\template_part('partials/entry-meta'); ?>
</header>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
</article>

View File

@@ -0,0 +1,2 @@
<time class="updated" datetime="<?= get_post_time('c', true); ?>"><?= get_the_date(); ?></time>
<p class="byline author vcard"><?= __('By', 'sage'); ?> <a href="<?= get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author" class="fn"><?= get_the_author(); ?></a></p>

View File

@@ -0,0 +1,5 @@
<footer class="content-info">
<div class="container">
<?php dynamic_sidebar('sidebar-footer'); ?>
</div>
</footer>

View File

@@ -0,0 +1,6 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>

View File

@@ -0,0 +1,12 @@
<header class="banner">
<div class="container">
<a class="brand" href="<?= esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a>
<nav class="nav-primary">
<?php
if (has_nav_menu('primary_navigation')) :
wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav']);
endif;
?>
</nav>
</div>
</header>

View File

@@ -0,0 +1,3 @@
<div class="page-header">
<h1><?php App\title(); ?></h1>
</div>

View File

@@ -0,0 +1 @@
<?php dynamic_sidebar('sidebar-primary'); ?>