diff --git a/functions.php b/functions.php index fc3fc88..d80594c 100644 --- a/functions.php +++ b/functions.php @@ -2,15 +2,26 @@ /** * Roots includes */ -require_once locate_template('/lib/utils.php'); // Utility functions -require_once locate_template('/lib/init.php'); // Initial theme setup and constants -require_once locate_template('/lib/wrapper.php'); // Theme wrapper class -require_once locate_template('/lib/sidebar.php'); // Sidebar class -require_once locate_template('/lib/config.php'); // Configuration -require_once locate_template('/lib/activation.php'); // Theme activation -require_once locate_template('/lib/titles.php'); // Page titles -require_once locate_template('/lib/nav.php'); // Custom nav modifications -require_once locate_template('/lib/gallery.php'); // Custom [gallery] modifications -require_once locate_template('/lib/comments.php'); // Custom comments modifications -require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets -require_once locate_template('/lib/extras.php'); // Custom functions +$roots_includes = array( + '/lib/utils.php', // Utility functions + '/lib/init.php', // Initial theme setup and constants + '/lib/wrapper.php', // Theme wrapper class + '/lib/sidebar.php', // Sidebar class + '/lib/config.php', // Configuration + '/lib/activation.php', // Theme activation + '/lib/titles.php', // Page titles + '/lib/nav.php', // Custom nav modifications + '/lib/gallery.php', // Custom [gallery] modifications + '/lib/comments.php', // Custom comments modifications + '/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); diff --git a/lib/activation.php b/lib/activation.php index d7e55bf..4b677d6 100644 --- a/lib/activation.php +++ b/lib/activation.php @@ -123,7 +123,7 @@ function roots_theme_activation_action() { if ($roots_theme_activation_options['create_front_page'] === 'true') { $roots_theme_activation_options['create_front_page'] = false; - $default_pages = array('Home'); + $default_pages = array(__('Home', 'roots')); $existing_pages = get_pages(); $temp = array(); @@ -144,7 +144,7 @@ function roots_theme_activation_action() { $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('page_on_front', $home->ID); @@ -170,10 +170,10 @@ function roots_theme_activation_action() { $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) { - $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; } else { $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') { $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; $menu_items= wp_get_nav_menu_items($primary_nav_term_id); diff --git a/lib/comments.php b/lib/comments.php index 3b1f96f..afe1f11 100644 --- a/lib/comments.php +++ b/lib/comments.php @@ -38,6 +38,7 @@ class Roots_Walker_Comment extends Walker_Comment { call_user_func($args['end-callback'], $comment, $args, $depth); return; } + // Close ".media-body"
located in templates/comment.php, and then the comment's
  • echo "
  • \n"; } } diff --git a/lib/titles.php b/lib/titles.php index 6ef7743..21f8c05 100644 --- a/lib/titles.php +++ b/lib/titles.php @@ -23,7 +23,7 @@ function roots_title() { return sprintf(__('Yearly Archives: %s', 'roots'), get_the_date('Y')); } elseif (is_author()) { $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 { return single_cat_title('', false); } @@ -34,4 +34,4 @@ function roots_title() { } else { return get_the_title(); } -} \ No newline at end of file +} diff --git a/lib/utils.php b/lib/utils.php index bec9f28..118c2f3 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -4,7 +4,7 @@ */ function is_element_empty($element) { $element = trim($element); - return empty($element) ? false : true; + return !empty($element); } // Tell WordPress to use searchform.php from the templates/ directory diff --git a/templates/comment.php b/templates/comment.php index 8454e7c..5a0ed55 100644 --- a/templates/comment.php +++ b/templates/comment.php @@ -1,7 +1,7 @@

    - + comment_approved == '0') : ?> diff --git a/templates/comments.php b/templates/comments.php index 1a93450..84eb59b 100644 --- a/templates/comments.php +++ b/templates/comments.php @@ -2,9 +2,10 @@ if (post_password_required()) { return; } +?> - if (have_comments()) : ?> -
    +
    +

      @@ -12,36 +13,32 @@
    1 && get_option('page_comments')) : ?> - + -
    - -
    +
    + +
    -
    - - - -
    +
    -
    - + +
    - -
    +
    +

    @@ -51,7 +48,7 @@

    %s.', 'roots'), get_option('siteurl'), $user_identity); ?> - +

    @@ -76,5 +73,5 @@ ID); ?> -
    - + +
    diff --git a/templates/footer.php b/templates/footer.php index f6392a1..f34fe5f 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -1,7 +1,6 @@