Merge master

This commit is contained in:
Ben Word
2014-06-30 00:24:08 -05:00
8 changed files with 57 additions and 49 deletions

View File

@@ -2,15 +2,26 @@
/** /**
* Roots includes * Roots includes
*/ */
require_once locate_template('/lib/utils.php'); // Utility functions $roots_includes = array(
require_once locate_template('/lib/init.php'); // Initial theme setup and constants '/lib/utils.php', // Utility functions
require_once locate_template('/lib/wrapper.php'); // Theme wrapper class '/lib/init.php', // Initial theme setup and constants
require_once locate_template('/lib/sidebar.php'); // Sidebar class '/lib/wrapper.php', // Theme wrapper class
require_once locate_template('/lib/config.php'); // Configuration '/lib/sidebar.php', // Sidebar class
require_once locate_template('/lib/activation.php'); // Theme activation '/lib/config.php', // Configuration
require_once locate_template('/lib/titles.php'); // Page titles '/lib/activation.php', // Theme activation
require_once locate_template('/lib/nav.php'); // Custom nav modifications '/lib/titles.php', // Page titles
require_once locate_template('/lib/gallery.php'); // Custom [gallery] modifications '/lib/nav.php', // Custom nav modifications
require_once locate_template('/lib/comments.php'); // Custom comments modifications '/lib/gallery.php', // Custom [gallery] modifications
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets '/lib/comments.php', // Custom comments modifications
require_once locate_template('/lib/extras.php'); // Custom functions '/lib/scripts.php', // Scripts and stylesheets
'/lib/extras.php', // Custom functions
);
foreach ($roots_includes as $file) {
if (!$filepath = locate_template($file)) {
trigger_error("Error locating `$file` for inclusion!", E_USER_ERROR);
}
require_once $filepath;
}
unset($file, $filepath);

View File

@@ -123,7 +123,7 @@ function roots_theme_activation_action() {
if ($roots_theme_activation_options['create_front_page'] === 'true') { if ($roots_theme_activation_options['create_front_page'] === 'true') {
$roots_theme_activation_options['create_front_page'] = false; $roots_theme_activation_options['create_front_page'] = false;
$default_pages = array('Home'); $default_pages = array(__('Home', 'roots'));
$existing_pages = get_pages(); $existing_pages = get_pages();
$temp = array(); $temp = array();
@@ -144,7 +144,7 @@ function roots_theme_activation_action() {
$result = wp_insert_post($add_default_pages); $result = wp_insert_post($add_default_pages);
} }
$home = get_page_by_title('Home'); $home = get_page_by_title(__('Home', 'roots'));
update_option('show_on_front', 'page'); update_option('show_on_front', 'page');
update_option('page_on_front', $home->ID); update_option('page_on_front', $home->ID);
@@ -170,10 +170,10 @@ function roots_theme_activation_action() {
$roots_nav_theme_mod = false; $roots_nav_theme_mod = false;
$primary_nav = wp_get_nav_menu_object('Primary Navigation'); $primary_nav = wp_get_nav_menu_object(__('Primary Navigation', 'roots'));
if (!$primary_nav) { if (!$primary_nav) {
$primary_nav_id = wp_create_nav_menu('Primary Navigation', array('slug' => 'primary_navigation')); $primary_nav_id = wp_create_nav_menu(__('Primary Navigation', 'roots'), array('slug' => 'primary_navigation'));
$roots_nav_theme_mod['primary_navigation'] = $primary_nav_id; $roots_nav_theme_mod['primary_navigation'] = $primary_nav_id;
} else { } else {
$roots_nav_theme_mod['primary_navigation'] = $primary_nav->term_id; $roots_nav_theme_mod['primary_navigation'] = $primary_nav->term_id;
@@ -187,7 +187,7 @@ function roots_theme_activation_action() {
if ($roots_theme_activation_options['add_pages_to_primary_navigation'] === 'true') { if ($roots_theme_activation_options['add_pages_to_primary_navigation'] === 'true') {
$roots_theme_activation_options['add_pages_to_primary_navigation'] = false; $roots_theme_activation_options['add_pages_to_primary_navigation'] = false;
$primary_nav = wp_get_nav_menu_object('Primary Navigation'); $primary_nav = wp_get_nav_menu_object(__('Primary Navigation', 'roots'));
$primary_nav_term_id = (int) $primary_nav->term_id; $primary_nav_term_id = (int) $primary_nav->term_id;
$menu_items= wp_get_nav_menu_items($primary_nav_term_id); $menu_items= wp_get_nav_menu_items($primary_nav_term_id);

View File

@@ -38,6 +38,7 @@ class Roots_Walker_Comment extends Walker_Comment {
call_user_func($args['end-callback'], $comment, $args, $depth); call_user_func($args['end-callback'], $comment, $args, $depth);
return; return;
} }
// Close ".media-body" <div> located in templates/comment.php, and then the comment's <li>
echo "</div></li>\n"; echo "</div></li>\n";
} }
} }

View File

@@ -23,7 +23,7 @@ function roots_title() {
return sprintf(__('Yearly Archives: %s', 'roots'), get_the_date('Y')); return sprintf(__('Yearly Archives: %s', 'roots'), get_the_date('Y'));
} elseif (is_author()) { } elseif (is_author()) {
$author = get_queried_object(); $author = get_queried_object();
return sprintf(__('Author Archives: %s', 'roots'), $author->display_name); return sprintf(__('Author Archives: %s', 'roots'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
} else { } else {
return single_cat_title('', false); return single_cat_title('', false);
} }
@@ -34,4 +34,4 @@ function roots_title() {
} else { } else {
return get_the_title(); return get_the_title();
} }
} }

View File

@@ -4,7 +4,7 @@
*/ */
function is_element_empty($element) { function is_element_empty($element) {
$element = trim($element); $element = trim($element);
return empty($element) ? false : true; return !empty($element);
} }
// Tell WordPress to use searchform.php from the templates/ directory // Tell WordPress to use searchform.php from the templates/ directory

View File

@@ -1,7 +1,7 @@
<?php echo get_avatar($comment, $size = '64'); ?> <?php echo get_avatar($comment, $size = '64'); ?>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4> <h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4>
<time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'roots'), get_comment_date(), get_comment_time()); ?></a></time> <time datetime="<?php echo get_comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'roots'), get_comment_date(), get_comment_time()); ?></a></time>
<?php edit_comment_link(__('(Edit)', 'roots'), '', ''); ?> <?php edit_comment_link(__('(Edit)', 'roots'), '', ''); ?>
<?php if ($comment->comment_approved == '0') : ?> <?php if ($comment->comment_approved == '0') : ?>

View File

@@ -2,9 +2,10 @@
if (post_password_required()) { if (post_password_required()) {
return; return;
} }
?>
if (have_comments()) : ?> <section id="comments">
<section id="comments"> <?php if (have_comments()) : ?>
<h3><?php printf(_n('One Response to &ldquo;%2$s&rdquo;', '%1$s Responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'roots'), number_format_i18n(get_comments_number()), get_the_title()); ?></h3> <h3><?php printf(_n('One Response to &ldquo;%2$s&rdquo;', '%1$s Responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'roots'), number_format_i18n(get_comments_number()), get_the_title()); ?></h3>
<ol class="media-list"> <ol class="media-list">
@@ -12,36 +13,32 @@
</ol> </ol>
<?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?> <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?>
<nav> <nav>
<ul class="pager"> <ul class="pager">
<?php if (get_previous_comments_link()) : ?> <?php if (get_previous_comments_link()) : ?>
<li class="previous"><?php previous_comments_link(__('&larr; Older comments', 'roots')); ?></li> <li class="previous"><?php previous_comments_link(__('&larr; Older comments', 'roots')); ?></li>
<?php endif; ?> <?php endif; ?>
<?php if (get_next_comments_link()) : ?> <?php if (get_next_comments_link()) : ?>
<li class="next"><?php next_comments_link(__('Newer comments &rarr;', 'roots')); ?></li> <li class="next"><?php next_comments_link(__('Newer comments &rarr;', 'roots')); ?></li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
</nav> </nav>
<?php endif; ?> <?php endif; ?>
<?php if (!comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')) : ?> <?php if (!comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')) : ?>
<div class="alert alert-warning"> <div class="alert alert-warning">
<?php _e('Comments are closed.', 'roots'); ?> <?php _e('Comments are closed.', 'roots'); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</section><!-- /#comments --> <?php elseif(!comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')) : ?>
<?php endif; ?>
<?php if (!have_comments() && !comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')) : ?>
<section id="comments">
<div class="alert alert-warning"> <div class="alert alert-warning">
<?php _e('Comments are closed.', 'roots'); ?> <?php _e('Comments are closed.', 'roots'); ?>
</div> </div>
</section><!-- /#comments --> <?php endif; ?>
<?php endif; ?> </section><!-- /#comments -->
<?php if (comments_open()) : ?> <section id="respond">
<section id="respond"> <?php if (comments_open()) : ?>
<h3><?php comment_form_title(__('Leave a Reply', 'roots'), __('Leave a Reply to %s', 'roots')); ?></h3> <h3><?php comment_form_title(__('Leave a Reply', 'roots'), __('Leave a Reply to %s', 'roots')); ?></h3>
<p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p> <p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p>
<?php if (get_option('comment_registration') && !is_user_logged_in()) : ?> <?php if (get_option('comment_registration') && !is_user_logged_in()) : ?>
@@ -51,7 +48,7 @@
<?php if (is_user_logged_in()) : ?> <?php if (is_user_logged_in()) : ?>
<p> <p>
<?php printf(__('Logged in as <a href="%s/wp-admin/profile.php">%s</a>.', 'roots'), get_option('siteurl'), $user_identity); ?> <?php printf(__('Logged in as <a href="%s/wp-admin/profile.php">%s</a>.', 'roots'), get_option('siteurl'), $user_identity); ?>
<a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php __('Log out of this account', 'roots'); ?>"><?php _e('Log out &raquo;', 'roots'); ?></a> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account', 'roots'); ?>"><?php _e('Log out &raquo;', 'roots'); ?></a>
</p> </p>
<?php else : ?> <?php else : ?>
<div class="form-group"> <div class="form-group">
@@ -76,5 +73,5 @@
<?php do_action('comment_form', $post->ID); ?> <?php do_action('comment_form', $post->ID); ?>
</form> </form>
<?php endif; ?> <?php endif; ?>
</section><!-- /#respond --> <?php endif; ?>
<?php endif; ?> </section><!-- /#respond -->

View File

@@ -1,7 +1,6 @@
<footer class="content-info" role="contentinfo"> <footer class="content-info" role="contentinfo">
<div class="container"> <div class="container">
<?php dynamic_sidebar('sidebar-footer'); ?> <?php dynamic_sidebar('sidebar-footer'); ?>
<p>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></p>
</div> </div>
</footer> </footer>