Skip to content

Commit

Permalink
Add theme wrapper, re-organize template files
Browse files Browse the repository at this point in the history
- Implement scribu’s Theme Wrapper (see base.php)

- Move templates, comments.php, and searchform.php to templates/ folder

- Rename loop- files to content-

- Remove all hooks except roots_head and roots_footer

- Use templates/page-header.php for page titles

- Use head.php for everything in <head>
  • Loading branch information
retlehs committed Aug 18, 2012
1 parent b54328c commit db41099
Show file tree
Hide file tree
Showing 34 changed files with 274 additions and 554 deletions.
39 changes: 15 additions & 24 deletions 404.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
<?php get_header(); ?>
<?php roots_content_before(); ?>
<div id="content" class="<?php echo CONTAINER_CLASSES; ?>">
<?php roots_main_before(); ?>
<div id="main" class="<?php echo FULLWIDTH_CLASSES; ?>" role="main">
<div class="page-header">
<h1><?php _e('File Not Found', 'roots'); ?></h1>
</div>
<div class="alert alert-block fade in">
<a class="close" data-dismiss="alert">&times;</a>
<p><?php _e('The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.', 'roots'); ?></p>
</div>
<p><?php _e('Please try the following:', 'roots'); ?></p>
<ul>
<li><?php _e('Check your spelling', 'roots'); ?></li>
<li><?php printf(__('Return to the <a href="%s">home page</a>', 'roots'), home_url()); ?></li>
<li><?php _e('Click the <a href="javascript:history.back()">Back</a> button', 'roots'); ?></li>
</ul>
<?php get_search_form(); ?>
</div><!-- /#main -->
<?php roots_main_after(); ?>
</div><!-- /#content -->
<?php roots_content_after(); ?>
<?php get_footer(); ?>
<?php get_template_part('templates/page', 'header'); ?>

<div class="alert alert-block fade in">
<a class="close" data-dismiss="alert">&times;</a>
<p><?php _e('The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.', 'roots'); ?></p>
</div>

<p><?php _e('Please try the following:', 'roots'); ?></p>
<ul>
<li><?php _e('Check your spelling', 'roots'); ?></li>
<li><?php printf(__('Return to the <a href="%s">home page</a>', 'roots'), home_url()); ?></li>
<li><?php _e('Click the <a href="javascript:history.back()">Back</a> button', 'roots'); ?></li>
</ul>

<?php get_search_form(); ?>
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### HEAD
* Implement scribu's [Theme Wrapper](http://scribu.net/wordpress/theme-wrappers.html) (see `base.php`)
* Move templates, `comments.php`, and `searchform.php` to `templates/` folder
* Rename `loop-` files to `content-`
* Remove all hooks except `roots_head` and `roots_footer`
* Use `templates/page-header.php` for page titles
* Use `head.php` for everything in `<head>`

### 5.2.0: August 18th, 2012
* Update to jQuery 1.8.0 and Modernizr 2.6.1
* Fix duplicate active class in `wp_nav_menu` items
Expand Down
44 changes: 0 additions & 44 deletions archive.php

This file was deleted.

31 changes: 31 additions & 0 deletions base.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php get_template_part('templates/head'); ?>
<body <?php body_class(); ?>>

<!--[if lt IE 7]><div class="alert">Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</div><![endif]-->

<?php
// Use Bootstrap's navbar if enabled in config.php
if (current_theme_supports('bootstrap-top-navbar')) {
get_template_part('templates/header-top-navbar');
} else {
get_template_part('templates/header');
}
?>

<div id="wrap" class="container" role="document">
<div id="content" class="row">
<div id="main" class="<?php roots_main_class(); ?>" role="main">
<?php include roots_template_path(); ?>
</div>
<?php if (roots_sidebar()) { ?>
<aside id="sidebar" class="<?php roots_sidebar_class(); ?>" role="complementary">
<?php get_template_part('templates/sidebar'); ?>
</aside>
<?php } ?>
</div><!-- /#content -->
</div><!-- /#wrap -->

<?php get_template_part('templates/footer'); ?>

</body>
</html>
16 changes: 8 additions & 8 deletions css/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* =============================================================================
/* ==========================================================================
Base
========================================================================== */

Expand All @@ -18,31 +18,31 @@ body.admin-bar .navbar-fixed-top { top: 28px; }



/* =============================================================================
/* ==========================================================================
Content
========================================================================== */

#content { }



/* =============================================================================
/* ==========================================================================
Primary Content
========================================================================== */

#main { }



/* =============================================================================
/* ==========================================================================
Sidebar
========================================================================== */

#sidebar { }



/* =============================================================================
/* ==========================================================================
Posts
========================================================================== */

Expand All @@ -54,15 +54,15 @@ body.admin-bar .navbar-fixed-top { top: 28px; }



/* =============================================================================
/* ==========================================================================
Footer
========================================================================== */

#content-info { }



/* =============================================================================
/* ==========================================================================
WordPress Generated Classes
See: http://codex.wordpress.org/CSS#WordPress_Generated_Classes
========================================================================== */
Expand All @@ -74,7 +74,7 @@ figure.alignnone { margin-left: 0; margin-right: 0; }



/* =============================================================================
/* ==========================================================================
Media Queries
========================================================================== */

Expand Down
134 changes: 0 additions & 134 deletions css/main.css

This file was deleted.

16 changes: 0 additions & 16 deletions footer.php

This file was deleted.

20 changes: 0 additions & 20 deletions front-page.php

This file was deleted.

Loading

0 comments on commit db41099

Please sign in to comment.