Whitespace fixes

Replaced all hard tabs with spaces. Removed all trailing whitespace.
This commit is contained in:
Scott Walkinshaw
2011-10-23 19:29:54 -06:00
parent 484534acd0
commit 39b0eb190f
28 changed files with 1592 additions and 1597 deletions

42
404.php
View File

@@ -1,22 +1,22 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" role="main"> <div id="main" role="main">
<div class="container"> <div class="container">
<h1><?php _e('File Not Found', 'roots'); ?></h1> <h1><?php _e('File Not Found', 'roots'); ?></h1>
<div class="error"> <div class="error">
<p class="bottom"><?php _e('The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.', 'roots'); ?></p> <p class="bottom"><?php _e('The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.', 'roots'); ?></p>
</div> </div>
<p><?php _e('Please try the following:', 'roots'); ?></p> <p><?php _e('Please try the following:', 'roots'); ?></p>
<ul> <ul>
<li><?php _e('Check your spelling', 'roots'); ?> </li> <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 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> <li><?php _e('Click the <a href="javascript:history.back()">Back</a> button', 'roots'); ?></li>
</ul> </ul>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

174
README.md
View File

@@ -4,172 +4,172 @@
### 3.6.0: August 12th, 2011 ### 3.6.0: August 12th, 2011
<ul> <ul>
<li>HTML5 Boilerplate 2.0 updates</li> <li>HTML5 Boilerplate 2.0 updates</li>
<li>Cleaner output of enqueued styles and scripts</li> <li>Cleaner output of enqueued styles and scripts</li>
<li>Added option for root relative URLs</li> <li>Added option for root relative URLs</li>
<li>Small fixes to root relative URLs and clean assets</li> <li>Small fixes to root relative URLs and clean assets</li>
<li>Updated included jQuery plugins</li> <li>Updated included jQuery plugins</li>
<li>Added French translation (thanks @johnraz)</li> <li>Added French translation (thanks @johnraz)</li>
<li>Added Brazilian Portuguese translation (thanks @weslly)</li> <li>Added Brazilian Portuguese translation (thanks @weslly)</li>
<li>Switched the logo to use <code>add_custom_image_header</code></li> <li>Switched the logo to use <code>add_custom_image_header</code></li>
<li>Added a function that strips unnecessary self-closing tags</li> <li>Added a function that strips unnecessary self-closing tags</li>
<li>Code cleanup and re-organization</li> <li>Code cleanup and re-organization</li>
</ul> </ul>
### 3.5.0: July 30th, 2011 ### 3.5.0: July 30th, 2011
<ul> <ul>
<li>Complete rewrite of theme options based on Twenty Eleven</li> <li>Complete rewrite of theme options based on Twenty Eleven</li>
<li>CSS frameworks: refactored code and added default classes for each framework</li> <li>CSS frameworks: refactored code and added default classes for each framework</li>
<li>CSS frameworks: added support for Adapt.js and LESS</li> <li>CSS frameworks: added support for Adapt.js and LESS</li>
<li>CSS frameworks: added option for None</li> <li>CSS frameworks: added option for None</li>
<li>Added support for WPML and theme translation</li> <li>Added support for WPML and theme translation</li>
<li>Added option for cleaner nav menu output</li> <li>Added option for cleaner nav menu output</li>
<li>Added option for FOUT-B-Gone</li> <li>Added option for FOUT-B-Gone</li>
<li>Added authorship rel attribute to post author link</li> <li>Added authorship rel attribute to post author link</li>
<li>Activation bugfix for pages being added multiple times</li> <li>Activation bugfix for pages being added multiple times</li>
<li>Bugfixes to the root relative URL function</li> <li>Bugfixes to the root relative URL function</li>
<li>Child themes will now load their CSS automatically and properly</li> <li>Child themes will now load their CSS automatically and properly</li>
<li>HTML5 Boilerplate updates (including Normalize.css, Modernizr 2.0, and Respond.js)</li> <li>HTML5 Boilerplate updates (including Normalize.css, Modernizr 2.0, and Respond.js)</li>
<li>Cleaner way of including HTML5 Boilerplate's <code>.htaccess</code></li> <li>Cleaner way of including HTML5 Boilerplate's <code>.htaccess</code></li>
<li>Added hooks &amp; actions (and moved lots of code into them)</li> <li>Added hooks &amp; actions (and moved lots of code into them)</li>
<li>Renamed <code>includes/</code> directory to <code>inc/</code></li> <li>Renamed <code>includes/</code> directory to <code>inc/</code></li>
<li>Added a blank <code>inc/roots-custom.php</code> file</li> <li>Added a blank <code>inc/roots-custom.php</code> file</li>
</ul> </ul>
### 3.2.4: May 19th, 2011 ### 3.2.4: May 19th, 2011
<ul> <ul>
<li>Bugfixes</li> <li>Bugfixes</li>
<li>Matching latest changes to HTML5 Boilerplate and Blueprint CSS</li> <li>Matching latest changes to HTML5 Boilerplate and Blueprint CSS</li>
<li>Updated jQuery to 1.6.1</li> <li>Updated jQuery to 1.6.1</li>
</ul> </ul>
### 3.2.3: May 10th, 2011 ### 3.2.3: May 10th, 2011
<ul> <ul>
<li>Bugfixes</li> <li>Bugfixes</li>
<li>Added <code>language_attributes()</code> to <code>&lt;html&gt;</code></li> <li>Added <code>language_attributes()</code> to <code>&lt;html&gt;</code></li>
<li>Matching latest changes to HTML5 Boilerplate and Blueprint CSS</li> <li>Matching latest changes to HTML5 Boilerplate and Blueprint CSS</li>
<li>Updated jQuery to 1.6</li> <li>Updated jQuery to 1.6</li>
</ul> </ul>
### 3.2.2: April 24th, 2011 ### 3.2.2: April 24th, 2011
<ul> <ul>
<li>Bugfixes</li> <li>Bugfixes</li>
</ul> </ul>
### 3.2.1: April 20th, 2011 ### 3.2.1: April 20th, 2011
<ul> <ul>
<li>Added support for child themes</li> <li>Added support for child themes</li>
</ul> </ul>
### 3.2.0: April 15th, 2011 ### 3.2.0: April 15th, 2011
<ul> <ul>
<li>Added support for the 1140px Grid</li> <li>Added support for the 1140px Grid</li>
<li>Updated the conditional comment code to match latest changes to HTML5 Boilerplate</li> <li>Updated the conditional comment code to match latest changes to HTML5 Boilerplate</li>
</ul> </ul>
### 3.1.1: April 7th, 2011 ### 3.1.1: April 7th, 2011
<ul> <ul>
<li>Fixed relative path function to work correctly when WordPress is installed in a subdirectory</li> <li>Fixed relative path function to work correctly when WordPress is installed in a subdirectory</li>
<li>Updated jQuery to 1.5.2</li> <li>Updated jQuery to 1.5.2</li>
<li>Fixed comments to show avatars correctly</li> <li>Fixed comments to show avatars correctly</li>
</ul> </ul>
### 3.1.0: April 1st, 2011 ### 3.1.0: April 1st, 2011
<ul> <ul>
<li>Added support for 960.gs thanks to John Liuti</li> <li>Added support for 960.gs thanks to John Liuti</li>
<li>Added more onto the <code>.htaccess</code> from HTML5 Boilerplate</li> <li>Added more onto the <code>.htaccess</code> from HTML5 Boilerplate</li>
<li>Made the theme directory and name renamable</li> <li>Made the theme directory and name renamable</li>
</ul> </ul>
### 3.0.0: March 28th, 2011 ### 3.0.0: March 28th, 2011
<ul> <ul>
<li>Changed name from BB to Roots</li> <li>Changed name from BB to Roots</li>
<li>Updated various areas to match the latest changes to HTML5 Boilerplate</li> <li>Updated various areas to match the latest changes to HTML5 Boilerplate</li>
<li>Changed the theme markup based on hCard/Readability Guidelines and work by Jonathan Neal</li> <li>Changed the theme markup based on hCard/Readability Guidelines and work by Jonathan Neal</li>
<li>Theme activation now creates the navigation menus and automatically sets their locations</li> <li>Theme activation now creates the navigation menus and automatically sets their locations</li>
<li>Permalink structure is now set to <code>/%year%/%postname%/</code> for performance reasons</li> <li>Permalink structure is now set to <code>/%year%/%postname%/</code> for performance reasons</li>
<li>Uploads folder is now <code>/assets/</code> and not organized by month and date</li> <li>Uploads folder is now <code>/assets/</code> and not organized by month and date</li>
<li>All static folders in <code>/wp-content/themes/roots/</code> (<code>css/</code>, <code>js/</code>, <code>img/</code>) now rewrite to the root (<code>/css/</code>, <code>/js/</code>, <code>/img/</code>)</li> <li>All static folders in <code>/wp-content/themes/roots/</code> (<code>css/</code>, <code>js/</code>, <code>img/</code>) now rewrite to the root (<code>/css/</code>, <code>/js/</code>, <code>/img/</code>)</li>
<li><code>/wp-content/plugins/</code> now rewrites to <code>/plugins/</code></li> <li><code>/wp-content/plugins/</code> now rewrites to <code>/plugins/</code></li>
<li>More root relative URLs on WordPress functions</li> <li>More root relative URLs on WordPress functions</li>
<li>Search results (<code>/?s=query</code>) now rewrites to <code>/search/query/</code></li> <li>Search results (<code>/?s=query</code>) now rewrites to <code>/search/query/</code></li>
<li><code>l10n.js</code> is deregistered</li> <li><code>l10n.js</code> is deregistered</li>
<li>Gallery shortcode has been changed to output <code>&lt;figure&gt;</code> and <code>&lt;figcaption&gt;</code> and now links to the file by default</li> <li>Gallery shortcode has been changed to output <code>&lt;figure&gt;</code> and <code>&lt;figcaption&gt;</code> and now links to the file by default</li>
<li>Added more <code>loop.php</code> templates</li> <li>Added more <code>loop.php</code> templates</li>
<li>Made the HTML editor have a monospaced font</li> <li>Made the HTML editor have a monospaced font</li>
<li>Added <code>front-page.php</code></li> <li>Added <code>front-page.php</code></li>
<li>Updated CSS for Gravity Forms 1.5</li> <li>Updated CSS for Gravity Forms 1.5</li>
<li>Added <code>searchform.php template</code></li> <li>Added <code>searchform.php template</code></li>
</ul> </ul>
### 2.4.0: January 25th, 2011 ### 2.4.0: January 25th, 2011
<ul> <ul>
<li>Added a notification when saving the theme settings</li> <li>Added a notification when saving the theme settings</li>
<li>Added support for navigation menus</li> <li>Added support for navigation menus</li>
<li>Created function that makes sure there is a Home page on theme activation</li> <li>Created function that makes sure there is a Home page on theme activation</li>
<li>Updated various areas to match the latest changes to HTML5 Boilerplate</li> <li>Updated various areas to match the latest changes to HTML5 Boilerplate</li>
</ul> </ul>
### 2.3.0: December 8th, 2010 ### 2.3.0: December 8th, 2010
<ul> <ul>
<li>Logo is no longer an <code>&lt;h1&gt;</code></li> <li>Logo is no longer an <code>&lt;h1&gt;</code></li>
<li>Added ARIA roles again</li> <li>Added ARIA roles again</li>
<li>Changed <code>ul#nav</code> to <code>nav#nav-main</code></li> <li>Changed <code>ul#nav</code> to <code>nav#nav-main</code></li>
<li>Added vCard to footer</li> <li>Added vCard to footer</li>
<li>Made all URL's root relative</li> <li>Made all URL's root relative</li>
<li>Added Twitter and Facebook widgets to footer</li> <li>Added Twitter and Facebook widgets to footer</li>
<li>Added SEO optimized <code>robots.txt</code> from WordPress codex</li> <li>Added SEO optimized <code>robots.txt</code> from WordPress codex</li>
</ul> </ul>
### 2.2.0: September 20th, 2010 ### 2.2.0: September 20th, 2010
<ul> <ul>
<li>Added asynchronous Google Analytics</li> <li>Added asynchronous Google Analytics</li>
<li>Updated <code>.htaccess</code> with latest changes from HTML5 Boilerplate</li> <li>Updated <code>.htaccess</code> with latest changes from HTML5 Boilerplate</li>
</ul> </ul>
### 2.1.0: August 19th, 2010 ### 2.1.0: August 19th, 2010
<ul> <ul>
<li>Removed optimizeLegibility from headings</li> <li>Removed optimizeLegibility from headings</li>
<li>Updated jQuery to latest version</li> <li>Updated jQuery to latest version</li>
<li>Implemented HTML5 Boilerplate <code>.htaccess</code></li> <li>Implemented HTML5 Boilerplate <code>.htaccess</code></li>
</ul> </ul>
### 2.0.1: August 2nd, 2010 ### 2.0.1: August 2nd, 2010
<ul> <ul>
<li>Added some presentational CSS classes</li> <li>Added some presentational CSS classes</li>
<li>Added footer widget</li> <li>Added footer widget</li>
<li>Added more Gravity Forms default styling</li> <li>Added more Gravity Forms default styling</li>
</ul> </ul>
### 2.0.0: July 19th, 2010 ### 2.0.0: July 19th, 2010
<ul> <ul>
<li>Added HTML5 Boilerplate changes</li> <li>Added HTML5 Boilerplate changes</li>
<li>Implemented <code>loop.php</code></li> <li>Implemented <code>loop.php</code></li>
<li>wp_head cleanup</li> <li>wp_head cleanup</li>
<li>Added <code>page-subpages.php</code> template</li> <li>Added <code>page-subpages.php</code> template</li>
</ul> </ul>
### 1.5.0: April 15th, 2010 ### 1.5.0: April 15th, 2010
<ul> <ul>
<li>Integrated Paul Irish's frontend-pro-template (the original HTML5 Boilerplate)</li> <li>Integrated Paul Irish's frontend-pro-template (the original HTML5 Boilerplate)</li>
</ul> </ul>
### 1.0.0: December 18th, 2009 ### 1.0.0: December 18th, 2009
<ul> <ul>
<li>Added Blueprint CSS to Starkers</li> <li>Added Blueprint CSS to Starkers</li>
</ul> </ul>
## Contributors: ## Contributors:
@@ -189,8 +189,8 @@ Major components:
Everything else: Everything else:
* [The Unlicense](http://unlicense.org) (aka: public domain) * [The Unlicense](http://unlicense.org) (aka: public domain)
## Summary: ## Summary:
Roots is a starting WordPress theme made for developers that's based on HTML5 Boilerplate, Blueprint CSS/960 Grid System/1140 Grid and Starkers that will help you rapidly create brochure sites and blogs. Roots is a starting WordPress theme made for developers that's based on HTML5 Boilerplate, Blueprint CSS/960 Grid System/1140 Grid and Starkers that will help you rapidly create brochure sites and blogs.

View File

@@ -1,35 +1,35 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container"> <div class="container">
<h1> <h1>
<?php if (is_day()) : ?> <?php if (is_day()) : ?>
<?php printf(__('Daily Archives: %s', 'roots'), get_the_date()); ?> <?php printf(__('Daily Archives: %s', 'roots'), get_the_date()); ?>
<?php elseif (is_month()) : ?> <?php elseif (is_month()) : ?>
<?php printf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y')); ?> <?php printf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y')); ?>
<?php elseif (is_year()) : ?> <?php elseif (is_year()) : ?>
<?php printf(__('Yearly Archives: %s', 'roots'), get_the_date('Y')); ?> <?php printf(__('Yearly Archives: %s', 'roots'), get_the_date('Y')); ?>
<?php else : ?> <?php else : ?>
<?php single_cat_title(); ?> <?php single_cat_title(); ?>
<?php endif; ?> <?php endif; ?>
</h1> </h1>
<?php roots_loop_before(); ?> <?php roots_loop_before(); ?>
<?php get_template_part('loop', 'category'); ?> <?php get_template_part('loop', 'category'); ?>
<?php roots_loop_after(); ?> <?php roots_loop_after(); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?> <?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary"> <aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?> <?php roots_sidebar_inside_before(); ?>
<div class="container"> <div class="container">
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> </div>
<?php roots_sidebar_inside_after(); ?> <?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?> <?php roots_sidebar_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -1,102 +1,102 @@
<?php function roots_comments($comment, $args, $depth) { <?php function roots_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?> $GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?>> <li <?php comment_class(); ?>>
<article id="comment-<?php comment_ID(); ?>"> <article id="comment-<?php comment_ID(); ?>">
<header class="comment-author vcard"> <header class="comment-author vcard">
<?php echo get_avatar($comment,$size='32'); ?> <?php echo get_avatar($comment,$size='32'); ?>
<?php printf(__('<cite class="fn">%s</cite>', 'roots'), get_comment_author_link()) ?> <?php printf(__('<cite class="fn">%s</cite>', 'roots'), get_comment_author_link()) ?>
<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 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'), '', '') ?>
</header> </header>
<?php if ($comment->comment_approved == '0') : ?> <?php if ($comment->comment_approved == '0') : ?>
<div class="notice"> <div class="notice">
<p class="bottom"><?php _e('Your comment is awaiting moderation.', 'roots') ?></p> <p class="bottom"><?php _e('Your comment is awaiting moderation.', 'roots') ?></p>
</div> </div>
<?php endif; ?>
<section class="comment">
<?php comment_text() ?>
</section>
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> <?php endif; ?>
</article> <section class="comment">
<?php comment_text() ?>
</section>
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</article>
<?php } ?> <?php } ?>
<?php <?php
// Do not delete these lines // Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die (__('Please do not load this page directly. Thanks!', 'roots')); die (__('Please do not load this page directly. Thanks!', 'roots'));
if ( post_password_required() ) { ?> if ( post_password_required() ) { ?>
<section id="comments"> <section id="comments">
<div class="notice"> <div class="notice">
<p class="bottom"><?php _e('This post is password protected. Enter the password to view comments.', 'roots'); ?></p> <p class="bottom"><?php _e('This post is password protected. Enter the password to view comments.', 'roots'); ?></p>
</div> </div>
</section> </section>
<?php <?php
return; return;
} }
?> ?>
<?php // You can start editing here. ?> <?php // You can start editing here. ?>
<?php if ( have_comments() ) : ?> <?php if ( have_comments() ) : ?>
<section id="comments"> <section id="comments">
<h3><?php comments_number(__('No Responses to', 'roots'), __('One Response to', 'roots'), __('% Responses to', 'roots') ); ?> &#8220;<?php the_title(); ?>&#8221;</h3> <h3><?php comments_number(__('No Responses to', 'roots'), __('One Response to', 'roots'), __('% Responses to', 'roots') ); ?> &#8220;<?php the_title(); ?>&#8221;</h3>
<ol class="commentlist"> <ol class="commentlist">
<?php wp_list_comments('type=comment&callback=roots_comments'); ?> <?php wp_list_comments('type=comment&callback=roots_comments'); ?>
<?php // wp_list_comments(); ?> <?php // wp_list_comments(); ?>
</ol> </ol>
<footer> <footer>
<nav id="comments-nav"> <nav id="comments-nav">
<div class="comments-previous"><?php previous_comments_link( __( '&larr; Older comments', 'roots' ) ); ?></div> <div class="comments-previous"><?php previous_comments_link( __( '&larr; Older comments', 'roots' ) ); ?></div>
<div class="comments-next"><?php next_comments_link( __( 'Newer comments &rarr;', 'roots' ) ); ?></div> <div class="comments-next"><?php next_comments_link( __( 'Newer comments &rarr;', 'roots' ) ); ?></div>
</nav> </nav>
</footer> </footer>
</section> </section>
<?php else : // this is displayed if there are no comments so far ?> <?php else : // this is displayed if there are no comments so far ?>
<?php if ( comments_open() ) : ?> <?php if ( comments_open() ) : ?>
<?php else : // comments are closed ?> <?php else : // comments are closed ?>
<section id="comments"> <section id="comments">
<div class="notice"> <div class="notice">
<p class="bottom"><?php _e('Comments are closed.', 'roots') ?></p> <p class="bottom"><?php _e('Comments are closed.', 'roots') ?></p>
</div> </div>
</section> </section>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<?php if ( comments_open() ) : ?> <?php if ( comments_open() ) : ?>
<section id="respond"> <section id="respond">
<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() ) : ?>
<p><?php printf( __('You must be <a href="%s">logged in</a> to post a comment.', 'roots'), wp_login_url( get_permalink() ) ); ?></p> <p><?php printf( __('You must be <a href="%s">logged in</a> to post a comment.', 'roots'), wp_login_url( get_permalink() ) ); ?></p>
<?php else : ?> <?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( is_user_logged_in() ) : ?> <?php if ( is_user_logged_in() ) : ?>
<p><?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></p> <p><?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></p>
<?php else : ?> <?php else : ?>
<p> <p>
<label for="author"><?php _e('Name', 'roots'); if ($req) _e(' (required)', 'roots'); ?></label> <label for="author"><?php _e('Name', 'roots'); if ($req) _e(' (required)', 'roots'); ?></label>
<input type="text" class="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?>> <input type="text" class="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?>>
</p> </p>
<p> <p>
<label for="email"><?php _e('Email (will not be published)', 'roots'); if ($req) _e(' (required)', 'roots'); ?></label> <label for="email"><?php _e('Email (will not be published)', 'roots'); if ($req) _e(' (required)', 'roots'); ?></label>
<input type="email" class="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?>> <input type="email" class="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?>>
</p> </p>
<p> <p>
<label for="url"><?php _e('Website', 'roots'); ?></label> <label for="url"><?php _e('Website', 'roots'); ?></label>
<input type="url" class="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3"> <input type="url" class="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3">
</p> </p>
<?php endif; ?> <?php endif; ?>
<p> <p>
<label for="comment"><?php _e('Comment', 'roots'); ?></label> <label for="comment"><?php _e('Comment', 'roots'); ?></label>
<textarea name="comment" id="comment" tabindex="4"></textarea> <textarea name="comment" id="comment" tabindex="4"></textarea>
</p> </p>
<p><input name="submit" class="button" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', 'roots'); ?>"></p> <p><input name="submit" class="button" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', 'roots'); ?>"></p>
<?php comment_id_fields(); ?> <?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?> <?php do_action('comment_form', $post->ID); ?>
</form> </form>
<?php endif; // If registration required and not logged in ?> <?php endif; // If registration required and not logged in ?>
</section> </section>
<?php endif; // if you delete this the sky will fall on your head ?> <?php endif; // if you delete this the sky will fall on your head ?>

View File

@@ -33,31 +33,31 @@ a:hover, a:active { color: #09f; outline: 0; }
a:active, input.button:active { outline: 0; position: relative; top: 1px; } a:active, input.button:active { outline: 0; position: relative; top: 1px; }
.button, #post-nav a, #comments-nav a { .button, #post-nav a, #comments-nav a {
display: inline-block; display: inline-block;
background: #06c; background: #06c;
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
background-image: linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
-moz-border-radius: 6px; -moz-border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
border-radius: 6px; border-radius: 6px;
color: #fff; color: #fff;
border: none; border: none;
padding: 8px 16px; padding: 8px 16px;
cursor: pointer; cursor: pointer;
text-decoration: none; text-decoration: none;
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15); text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15);
width: auto; width: auto;
overflow: visible; overflow: visible;
-moz-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset; -moz-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset; -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset; box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-appearance: none; -webkit-appearance: none;
} }
.button:hover, #post-nav a:hover, #comments-nav a:hover { .button:hover, #post-nav a:hover, #comments-nav a:hover {
background: #09f; background: #09f;
color: #fff; color: #fff;
} }
@@ -168,68 +168,68 @@ td { vertical-align: top; }
#logo { float: left; width: 300px; height: 75px; margin: 0 0 16px; padding: 0; } #logo { float: left; width: 300px; height: 75px; margin: 0 0 16px; padding: 0; }
#nav-main ul { #nav-main ul {
background: #06c; background: #06c;
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
background-image: linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); background-image: linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
position: relative; position: relative;
list-style: none; list-style: none;
margin: 0 0 16px 0; margin: 0 0 16px 0;
padding: 0; padding: 0;
float: left; float: left;
width: 100%; width: 100%;
-moz-border-radius: 6px; -moz-border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
border-radius: 6px; border-radius: 6px;
} }
#nav-main ul li { float: left; margin: 0; *zoom: 1; } #nav-main ul li { float: left; margin: 0; *zoom: 1; }
#nav-main ul li:hover { position: relative; } #nav-main ul li:hover { position: relative; }
#nav-main ul li a { #nav-main ul li a {
text-decoration: none; text-decoration: none;
display: block; display: block;
font-size: 14px; font-size: 14px;
padding: 8px 16px; padding: 8px 16px;
color: #fff; color: #fff;
margin: 0; margin: 0;
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15); text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15);
} }
#nav-main ul li a:hover, #nav-main ul li a:hover,
#nav-main ul li.current-menu-item > a, #nav-main ul li.current-menu-item > a,
#nav-main ul li.current-menu-parent > a, #nav-main ul li.current-menu-parent > a,
#nav-main ul li.current-menu-ancestor > a, #nav-main ul li.current-menu-ancestor > a,
#nav-main ul li:hover > a { #nav-main ul li:hover > a {
color: #73c8ff; color: #73c8ff;
} }
#nav-main ul ul { #nav-main ul ul {
position: absolute; position: absolute;
visibility: hidden; visibility: hidden;
top: 100%; top: 100%;
left: 0; left: 0;
width: 200px; width: 200px;
background: #73c8ff; background: #73c8ff;
padding: 0; padding: 0;
-moz-border-radius: 0; -moz-border-radius: 0;
-webkit-border-radius: 0; -webkit-border-radius: 0;
border-radius: 0; border-radius: 0;
} }
#nav-main ul ul li { float: none; } #nav-main ul ul li { float: none; }
#nav-main ul ul li a { #nav-main ul ul li a {
font-size: 12px; font-size: 12px;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
padding: 4px 16px; padding: 4px 16px;
width: 168px; /* account for the width of ul#nav-main ul and the padding on the anchor */ width: 168px; /* account for the width of ul#nav-main ul and the padding on the anchor */
display: inline-block; display: inline-block;
} }
#nav-main ul ul li a:hover, #nav-main ul ul li a:hover,
#nav-main ul ul li.current-menu-item > a, #nav-main ul ul li.current-menu-item > a,
#nav-main ul ul li.current-menu-parent > a, #nav-main ul ul li.current-menu-parent > a,
#nav-main ul ul li.current-menu-ancestor > a, #nav-main ul ul li.current-menu-ancestor > a,
#nav-main ul ul li:hover > a { #nav-main ul ul li:hover > a {
color: #06c; color: #06c;
} }
#nav-main ul ul ul { left: 100%; top: 0; } #nav-main ul ul ul { left: 100%; top: 0; }
@@ -252,14 +252,14 @@ td { vertical-align: top; }
/* ============================================================================= /* =============================================================================
Main content area Main content area
========================================================================== */ ========================================================================== */
#main { position: relative; } #main { position: relative; }
#main .container { padding: 0; } #main .container { padding: 0; }
/* ============================================================================= /* =============================================================================
Sidebar Sidebar
========================================================================== */ ========================================================================== */
#sidebar { position: relative; } #sidebar { position: relative; }
#sidebar .container { width: auto; padding: 0; } #sidebar .container { width: auto; padding: 0; }
#sidebar .widget { clear: both; margin-bottom: 1.5em; } #sidebar .widget { clear: both; margin-bottom: 1.5em; }
@@ -269,7 +269,7 @@ td { vertical-align: top; }
/* ============================================================================= /* =============================================================================
Posts Posts
========================================================================== */ ========================================================================== */
.hentry header { margin-bottom: 1.5em; } .hentry header { margin-bottom: 1.5em; }
.hentry h1 { line-height: 1.2em; margin-bottom: 0.2em; } .hentry h1 { line-height: 1.2em; margin-bottom: 0.2em; }
.hentry h2:first-child { line-height: 1.2em; margin-bottom: 0; } .hentry h2:first-child { line-height: 1.2em; margin-bottom: 0; }
@@ -298,7 +298,7 @@ td { vertical-align: top; }
/* ============================================================================= /* =============================================================================
Post comments Post comments
========================================================================== */ ========================================================================== */
ol.commentlist img.avatar { float: left; margin-right: 10px; } ol.commentlist img.avatar { float: left; margin-right: 10px; }
ol.commentlist time { display: block; font-size: 1em; margin-bottom: 0.5em; position: relative; } ol.commentlist time { display: block; font-size: 1em; margin-bottom: 0.5em; position: relative; }
ol.commentlist .comment-reply-link { display: block; margin-bottom: 1.5em; } ol.commentlist .comment-reply-link { display: block; margin-bottom: 1.5em; }
@@ -313,16 +313,16 @@ ol.commentlist .comment-reply-link { display: block; margin-bottom: 1.5em; }
/* ============================================================================= /* =============================================================================
Gallery Gallery
========================================================================== */ ========================================================================== */
figure.gallery-item { float: left; margin: 0 1em 1em 0; position: relative; } figure.gallery-item { float: left; margin: 0 1em 1em 0; position: relative; }
figure.gallery-item a img { figure.gallery-item a img {
border: 4px solid #bbb; border: 4px solid #bbb;
-moz-border-radius: 6px; -moz-border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
border-radius: 6px; border-radius: 6px;
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
} }
figure.gallery-item a:hover img { border-color: #ccc; } figure.gallery-item a:hover img { border-color: #ccc; }
figure.gallery-item figcaption { display: none; } figure.gallery-item figcaption { display: none; }
@@ -347,17 +347,17 @@ figure.gallery-item figcaption { display: none; }
.gform_wrapper { margin: 0; max-width: none; } .gform_wrapper { margin: 0; max-width: none; }
.gform_wrapper .gform_heading { width: 100%; margin-bottom: 1.5em; } .gform_wrapper .gform_heading { width: 100%; margin-bottom: 1.5em; }
.gform_wrapper .gsection .gfield_label, .gform_wrapper h2.gsection_title, .gform_wrapper h3.gform_title { font-size: 1.5em; font-weight: 400; } .gform_wrapper .gsection .gfield_label, .gform_wrapper h2.gsection_title, .gform_wrapper h3.gform_title { font-size: 1.5em; font-weight: 400; }
.gform_wrapper h3.gform_title { margin-top: 0; } .gform_wrapper h3.gform_title { margin-top: 0; }
.gform_wrapper .top_label .gfield_label { margin: 6px 0 0 0; } .gform_wrapper .top_label .gfield_label { margin: 6px 0 0 0; }
.gform_wrapper .top_label input.medium { padding-right: 0; } .gform_wrapper .top_label input.medium { padding-right: 0; }
.gform_wrapper .left_label .gfield_label, .gform_wrapper .left_label .gfield_label,
.gform_wrapper .right_label .gfield_label { margin: 10px 10px 0 0; } .gform_wrapper .right_label .gfield_label { margin: 10px 10px 0 0; }
.gform_wrapper .left_label ul.gfield_checkbox, .gform_wrapper .left_label ul.gfield_checkbox,
.gform_wrapper .left_label ul.gfield_radio, .gform_wrapper .left_label ul.gfield_radio,
.gform_wrapper .right_label ul.gfield_checkbox, .gform_wrapper .right_label ul.gfield_checkbox,
.gform_wrapper .right_label ul.gfield_radio { .gform_wrapper .right_label ul.gfield_radio {
margin: 9px 0 0 31%; margin: 9px 0 0 31%;
} }
.gform_wrapper input[type=text], .gform_wrapper input[type=text],
.gform_wrapper input[type=url], .gform_wrapper input[type=url],
@@ -368,18 +368,18 @@ figure.gallery-item figcaption { display: none; }
.gform_wrapper input[type=password], .gform_wrapper input[type=password],
.gform_wrapper textarea, .gform_wrapper textarea,
.gform_wrapper select { .gform_wrapper select {
font-size: 1em; font-size: 1em;
line-height: 14px; line-height: 14px;
padding: 4px; padding: 4px;
margin: 6px 0; margin: 6px 0;
border: 1px solid #bbb; border: 1px solid #bbb;
-moz-background-clip: padding; -moz-background-clip: padding;
-webkit-background-clip: padding; -webkit-background-clip: padding;
background-clip: padding-box; background-clip: padding-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
vertical-align: middle; vertical-align: middle;
} }
.gform_wrapper input[type=text]:focus, .gform_wrapper input[type=text]:focus,
.gform_wrapper input[type=url]:focus, .gform_wrapper input[type=url]:focus,
@@ -389,50 +389,50 @@ figure.gallery-item figcaption { display: none; }
.gform_wrapper input[type=password]:focus, .gform_wrapper input[type=password]:focus,
.gform_wrapper textarea:focus, .gform_wrapper textarea:focus,
.gform_wrapper select:focus { .gform_wrapper select:focus {
border: 1px solid #666; border: 1px solid #666;
} }
.gform_wrapper select { padding: 3px; } .gform_wrapper select { padding: 3px; }
.gform_wrapper .small, .gform_wrapper .large { font-size: 1em; line-height: 14px; } .gform_wrapper .small, .gform_wrapper .large { font-size: 1em; line-height: 14px; }
.gform_wrapper ul.right_label li, .gform_wrapper ul.right_label li,
.gform_wrapper ul.left_label li, .gform_wrapper ul.left_label li,
.gform_wrapper form ul.right_label li, .gform_wrapper form ul.right_label li,
.gform_wrapper form ul.left_label li { .gform_wrapper form ul.left_label li {
margin-bottom: 4px; margin-bottom: 4px;
} }
.gform_wrapper .description, .gform_wrapper .description,
.gform_wrapper .gfield_description, .gform_wrapper .gfield_description,
.gform_wrapper .gsection_description, .gform_wrapper .gsection_description,
.gform_wrapper .instruction { .gform_wrapper .instruction {
font-size: 0.9em; font-size: 0.9em;
font-style: normal; font-style: normal;
padding: 0; padding: 0;
} }
.gform_wrapper .right_label .gfield_description, .gform_wrapper .right_label .gfield_description,
.gform_wrapper .right_label .instruction, .gform_wrapper .right_label .instruction,
.gform_wrapper .left_label .gfield_description, .gform_wrapper .left_label .gfield_description,
.gform_wrapper .left_label .instruction { .gform_wrapper .left_label .instruction {
padding: 0; padding: 0;
margin-left: 31%; margin-left: 31%;
} }
.gform_wrapper .ginput_complex label, .gform_wrapper .ginput_complex label,
.gform_wrapper .gfield_time_hour label, .gform_wrapper .gfield_time_hour label,
.gform_wrapper .gfield_time_minute label, .gform_wrapper .gfield_time_minute label,
.gform_wrapper .gfield_date_month label, .gform_wrapper .gfield_date_month label,
.gform_wrapper .gfield_date_day label, .gform_wrapper .gfield_date_day label,
.gform_wrapper .gfield_date_year label, .gform_wrapper .gfield_date_year label,
.gform_wrapper .instruction { .gform_wrapper .instruction {
font-size: 0.9em; font-size: 0.9em;
font-weight: 400; font-weight: 400;
letter-spacing: 0; letter-spacing: 0;
margin: 0 0 6px 0; margin: 0 0 6px 0;
} }
.gform_wrapper .gfield_checkbox li input[type=checkbox], .gform_wrapper .gfield_checkbox li input[type=checkbox],
.gform_wrapper .gfield_radio li input[type=radio], .gform_wrapper .gfield_radio li input[type=radio],
.gform_wrapper .gfield_checkbox li input { float: none; display: inline-block; margin-top: 0; vertical-align: middle; } .gform_wrapper .gfield_checkbox li input { float: none; display: inline-block; margin-top: 0; vertical-align: middle; }
.gform_wrapper .gfield_checkbox li label, .gform_wrapper .gfield_radio li label { display: inline-block; margin: 0 0 0 8px; vertical-align: middle; } .gform_wrapper .gfield_checkbox li label, .gform_wrapper .gfield_radio li label { display: inline-block; margin: 0 0 0 8px; vertical-align: middle; }
.gform_wrapper .left_label .ginput_complex .ginput_right label, .gform_wrapper .left_label .ginput_complex .ginput_right label,
.gform_wrapper .left_label .ginput_complex .ginput_left label, .gform_wrapper .left_label .ginput_complex .ginput_left label,
.gform_wrapper .right_label .ginput_complex .ginput_right label, .gform_wrapper .right_label .ginput_complex .ginput_right label,
.gform_wrapper .right_label .ginput_complex .ginput_left label { word-spacing: 0; } .gform_wrapper .right_label .ginput_complex .ginput_left label { word-spacing: 0; }
.gform_wrapper .gfield_checkbox li label, .gform_wrapper .gfield_radio li label { font-weight: 400; } .gform_wrapper .gfield_checkbox li label, .gform_wrapper .gfield_radio li label { font-weight: 400; }
img.ui-datepicker-trigger { vertical-align: middle; } img.ui-datepicker-trigger { vertical-align: middle; }
@@ -449,19 +449,19 @@ img.ui-datepicker-trigger { vertical-align: middle; }
.gform_wrapper .validation_error { font-size: 1em; font-weight: 400; padding: 0.8em; margin-bottom: 1.5em; background: #fbe3e4; color: #8a1f11; border: 2px solid #fbc2c4; } .gform_wrapper .validation_error { font-size: 1em; font-weight: 400; padding: 0.8em; margin-bottom: 1.5em; background: #fbe3e4; color: #8a1f11; border: 2px solid #fbc2c4; }
.gform_wrapper .validation_message { display: none; } .gform_wrapper .validation_message { display: none; }
.gform_wrapper li.gfield.gfield_error { .gform_wrapper li.gfield.gfield_error {
background: none; background: none;
margin-bottom: 6px !important; margin-bottom: 6px !important;
padding: 0 !important; padding: 0 !important;
border: none; border: none;
} }
.gform_wrapper .top_label .gfield_error .ginput_container { max-width: none; } .gform_wrapper .top_label .gfield_error .ginput_container { max-width: none; }
.gform_wrapper .top_label .gfield_error { margin-bottom: 0 !important; } .gform_wrapper .top_label .gfield_error { margin-bottom: 0 !important; }
.gform_wrapper .gfield_error .gfield_label { color: #8a1f11; } .gform_wrapper .gfield_error .gfield_label { color: #8a1f11; }
.gform_wrapper .gfield_error input, .gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error select, .gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error textarea { background: #FBE3E4; border-color: #FBC2C4; } .gform_wrapper .gfield_error textarea { background: #FBE3E4; border-color: #FBC2C4; }
.gform_wrapper .top_label .gfield_error input, .gform_wrapper .top_label .gfield_error input,
.gform_wrapper .top_label .gfield_error textarea, .gform_wrapper .top_label .gfield_error textarea,
.gform_wrapper .top_label .gfield_error select { border-color: #FBC2C4; } .gform_wrapper .top_label .gfield_error select { border-color: #FBC2C4; }
.gform_wrapper .top_label .gfield_error { width: auto; } .gform_wrapper .top_label .gfield_error { width: auto; }
@@ -469,7 +469,7 @@ img.ui-datepicker-trigger { vertical-align: middle; }
/* ============================================================================= /* =============================================================================
Search form Search form
========================================================================== */ ========================================================================== */
#searchform #s { padding: 5px; } #searchform #s { padding: 5px; }
@@ -493,12 +493,12 @@ img.ui-datepicker-trigger { vertical-align: middle; }
========================================================================== */ ========================================================================== */
@media only screen and (min-width: 480px) { @media only screen and (min-width: 480px) {
/* Style adjustments for viewports 480px and over go here */ /* Style adjustments for viewports 480px and over go here */
} }
@media only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
/* Style adjustments for viewports 768px and over go here */ /* Style adjustments for viewports 768px and over go here */
} }
@@ -530,18 +530,18 @@ img.ui-datepicker-trigger { vertical-align: middle; }
/* ============================================================================= /* =============================================================================
Print styles Print styles
========================================================================== */ ========================================================================== */
@media print { @media print {
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
a, a:visited { text-decoration: underline; } a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; } a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; } abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; } thead { display: table-header-group; }
tr, img { page-break-inside: avoid; } tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; } img { max-width: 100% !important; }
@page { margin: 0.5cm; } @page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; } p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; } h2, h3 { page-break-after: avoid; }
} }

View File

@@ -1,21 +1,21 @@
<?php roots_footer_before(); ?> <?php roots_footer_before(); ?>
<footer id="content-info" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="contentinfo"> <footer id="content-info" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="contentinfo">
<?php roots_footer_inside(); ?> <?php roots_footer_inside(); ?>
<div class="container"> <div class="container">
<?php dynamic_sidebar("Footer"); ?> <?php dynamic_sidebar("Footer"); ?>
<p class="copy"><small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p> <p class="copy"><small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p>
</div> </div>
</footer> </footer>
<?php roots_footer_after(); ?> <?php roots_footer_after(); ?>
</div><!-- /#wrap --> </div><!-- /#wrap -->
<?php wp_footer(); ?> <?php wp_footer(); ?>
<?php roots_footer(); ?> <?php roots_footer(); ?>
<!--[if lt IE 7]> <!--[if lt IE 7]>
<script defer src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script> <script defer src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
<script defer>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script> <script defer>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
<![endif]--> <![endif]-->
</body> </body>
</html> </html>

View File

@@ -1,24 +1,24 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container"> <div class="container">
<?php roots_loop_before(); ?> <?php roots_loop_before(); ?>
<?php get_template_part('loop', 'page'); ?> <?php get_template_part('loop', 'page'); ?>
<?php roots_loop_after(); ?> <?php roots_loop_after(); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?> <?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary"> <aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?> <?php roots_sidebar_inside_before(); ?>
<div class="container"> <div class="container">
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> </div>
<?php roots_sidebar_inside_after(); ?> <?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?> <?php roots_sidebar_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -1,66 +1,66 @@
<?php // https://github.com/retlehs/roots/wiki <?php // https://github.com/retlehs/roots/wiki
require_once get_template_directory() . '/inc/roots-activation.php'; // activation require_once get_template_directory() . '/inc/roots-activation.php'; // activation
require_once get_template_directory() . '/inc/roots-options.php'; // theme options require_once get_template_directory() . '/inc/roots-options.php'; // theme options
require_once get_template_directory() . '/inc/roots-cleanup.php'; // cleanup require_once get_template_directory() . '/inc/roots-cleanup.php'; // cleanup
require_once get_template_directory() . '/inc/roots-htaccess.php'; // rewrites for assets, h5bp htaccess require_once get_template_directory() . '/inc/roots-htaccess.php'; // rewrites for assets, h5bp htaccess
require_once get_template_directory() . '/inc/roots-hooks.php'; // hooks require_once get_template_directory() . '/inc/roots-hooks.php'; // hooks
require_once get_template_directory() . '/inc/roots-actions.php'; // actions require_once get_template_directory() . '/inc/roots-actions.php'; // actions
require_once get_template_directory() . '/inc/roots-widgets.php'; // widgets require_once get_template_directory() . '/inc/roots-widgets.php'; // widgets
require_once get_template_directory() . '/inc/roots-custom.php'; // custom functions require_once get_template_directory() . '/inc/roots-custom.php'; // custom functions
$roots_options = roots_get_theme_options(); $roots_options = roots_get_theme_options();
// set the maximum 'Large' image width to the maximum grid width // set the maximum 'Large' image width to the maximum grid width
if (!isset($content_width)) { if (!isset($content_width)) {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
switch ($roots_css_framework) { switch ($roots_css_framework) {
case 'blueprint': $content_width = 950; break; case 'blueprint': $content_width = 950; break;
case '960gs_12': $content_width = 940; break; case '960gs_12': $content_width = 940; break;
case '960gs_16': $content_width = 940; break; case '960gs_16': $content_width = 940; break;
case '960gs_24': $content_width = 940; break; case '960gs_24': $content_width = 940; break;
case '1140': $content_width = 1140; break; case '1140': $content_width = 1140; break;
case 'adapt': $content_width = 940; break; case 'adapt': $content_width = 940; break;
default: $content_width = 950; break; default: $content_width = 950; break;
} }
} }
function roots_setup() { function roots_setup() {
load_theme_textdomain('roots', get_template_directory() . '/lang'); load_theme_textdomain('roots', get_template_directory() . '/lang');
// tell the TinyMCE editor to use editor-style.css
// if you have issues with getting the editor to show your changes then use the following line:
// add_editor_style('editor-style.css?' . time());
add_editor_style('editor-style.css');
// http://codex.wordpress.org/Post_Thumbnails
add_theme_support('post-thumbnails');
// set_post_thumbnail_size(150, 150, false);
// http://codex.wordpress.org/Post_Formats
// add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
// http://codex.wordpress.org/Function_Reference/add_custom_image_header
if (!defined('HEADER_TEXTCOLOR')) { define('HEADER_TEXTCOLOR', ''); }
if (!defined('NO_HEADER_TEXT')) { define('NO_HEADER_TEXT', true); }
if (!defined('HEADER_IMAGE')) { define('HEADER_IMAGE', get_template_directory_uri() . '/img/logo.png'); }
if (!defined('HEADER_IMAGE_WIDTH')) { define('HEADER_IMAGE_WIDTH', 300); }
if (!defined('HEADER_IMAGE_HEIGHT')) { define('HEADER_IMAGE_HEIGHT', 75); }
function roots_custom_image_header_site() { } // tell the TinyMCE editor to use editor-style.css
function roots_custom_image_header_admin() { ?> // if you have issues with getting the editor to show your changes then use the following line:
<style type="text/css"> // add_editor_style('editor-style.css?' . time());
.appearance_page_custom-header #headimg { min-height: 0; } add_editor_style('editor-style.css');
</style>
<?php } // http://codex.wordpress.org/Post_Thumbnails
add_custom_image_header('roots_custom_image_header_site', 'roots_custom_image_header_admin'); add_theme_support('post-thumbnails');
// set_post_thumbnail_size(150, 150, false);
add_theme_support('menus');
register_nav_menus(array( // http://codex.wordpress.org/Post_Formats
'primary_navigation' => __('Primary Navigation', 'roots'), // add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
'utility_navigation' => __('Utility Navigation', 'roots')
)); // http://codex.wordpress.org/Function_Reference/add_custom_image_header
if (!defined('HEADER_TEXTCOLOR')) { define('HEADER_TEXTCOLOR', ''); }
if (!defined('NO_HEADER_TEXT')) { define('NO_HEADER_TEXT', true); }
if (!defined('HEADER_IMAGE')) { define('HEADER_IMAGE', get_template_directory_uri() . '/img/logo.png'); }
if (!defined('HEADER_IMAGE_WIDTH')) { define('HEADER_IMAGE_WIDTH', 300); }
if (!defined('HEADER_IMAGE_HEIGHT')) { define('HEADER_IMAGE_HEIGHT', 75); }
function roots_custom_image_header_site() { }
function roots_custom_image_header_admin() { ?>
<style type="text/css">
.appearance_page_custom-header #headimg { min-height: 0; }
</style>
<?php }
add_custom_image_header('roots_custom_image_header_site', 'roots_custom_image_header_admin');
add_theme_support('menus');
register_nav_menus(array(
'primary_navigation' => __('Primary Navigation', 'roots'),
'utility_navigation' => __('Utility Navigation', 'roots')
));
} }
add_action('after_setup_theme', 'roots_setup'); add_action('after_setup_theme', 'roots_setup');
@@ -68,18 +68,18 @@ add_action('after_setup_theme', 'roots_setup');
// create widget areas: sidebar, footer // create widget areas: sidebar, footer
$sidebars = array('Sidebar', 'Footer'); $sidebars = array('Sidebar', 'Footer');
foreach ($sidebars as $sidebar) { foreach ($sidebars as $sidebar) {
register_sidebar(array('name'=> $sidebar, register_sidebar(array('name'=> $sidebar,
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">', 'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">',
'after_widget' => '</div></article>', 'after_widget' => '</div></article>',
'before_title' => '<h3>', 'before_title' => '<h3>',
'after_title' => '</h3>' 'after_title' => '</h3>'
)); ));
} }
// return post entry meta information // return post entry meta information
function roots_entry_meta() { function roots_entry_meta() {
echo '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'), get_the_time()) .'</time>'; echo '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'), get_the_time()) .'</time>';
echo '<p class="byline author vcard">'. __('Written by', 'roots') .' <a href="'. get_author_posts_url(get_the_author_meta('id')) .'" rel="author" class="fn">'. get_the_author() .'</a></p>'; echo '<p class="byline author vcard">'. __('Written by', 'roots') .' <a href="'. get_author_posts_url(get_the_author_meta('id')) .'" rel="author" class="fn">'. get_the_author() .'</a></p>';
} }
?> ?>

View File

@@ -4,63 +4,63 @@
<!--[if IE 8]> <html class="no-js ie8 oldie" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title> <title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<?php roots_stylesheets(); ?> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> Feed" href="<?php echo home_url(); ?>/feed/">
<script src="<?php echo get_template_directory_uri(); ?>/js/libs/modernizr-2.0.6.min.js"></script> <?php roots_stylesheets(); ?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="<?php echo get_template_directory_uri(); ?>/js/libs/jquery-1.6.4.min.js"><\/script>')</script>
<?php wp_head(); ?> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> Feed" href="<?php echo home_url(); ?>/feed/">
<?php roots_head(); ?>
<script defer src="<?php echo get_template_directory_uri(); ?>/js/plugins.js"></script> <script src="<?php echo get_template_directory_uri(); ?>/js/libs/modernizr-2.0.6.min.js"></script>
<script defer src="<?php echo get_template_directory_uri(); ?>/js/script.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="<?php echo get_template_directory_uri(); ?>/js/libs/jquery-1.6.4.min.js"><\/script>')</script>
<?php wp_head(); ?>
<?php roots_head(); ?>
<script defer src="<?php echo get_template_directory_uri(); ?>/js/plugins.js"></script>
<script defer src="<?php echo get_template_directory_uri(); ?>/js/script.js"></script>
</head> </head>
<body <?php body_class(roots_body_class()); ?>> <body <?php body_class(roots_body_class()); ?>>
<?php roots_wrap_before(); ?> <?php roots_wrap_before(); ?>
<div id="wrap" class="container" role="document"> <div id="wrap" class="container" role="document">
<?php roots_header_before(); ?> <?php roots_header_before(); ?>
<header id="banner" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="banner"> <header id="banner" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="banner">
<?php roots_header_inside(); ?> <?php roots_header_inside(); ?>
<div class="container"> <div class="container">
<a id="logo" href="<?php echo home_url(); ?>/">
<img src="<?php echo get_header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="<?php bloginfo('name'); ?>">
</a>
<nav id="nav-main" role="navigation">
<?php if ($roots_options['clean_menu']) { ?>
<?php wp_nav_menu(array('theme_location' => 'primary_navigation', 'walker' => new roots_nav_walker())); ?>
<?php } else { ?>
<?php wp_nav_menu(array('theme_location' => 'primary_navigation')); ?>
<?php } ?>
</nav>
<?php
$utility_nav = wp_get_nav_menu_object('Utility Navigation');
$utility_nav_term_id = (int) $utility_nav->term_id;
$menu_items = wp_get_nav_menu_items($utility_nav_term_id);
if ($menu_items || !empty($menu_items)) {
?>
<nav id="nav-utility">
<?php if ($roots_options['clean_menu']) { ?>
<?php wp_nav_menu(array('theme_location' => 'utility_navigation', 'walker' => new roots_nav_walker())); ?>
<?php } else { ?>
<?php wp_nav_menu(array('theme_location' => 'utility_navigation')); ?>
<?php } ?>
</nav>
<?php } ?>
</div> <a id="logo" href="<?php echo home_url(); ?>/">
</header> <img src="<?php echo get_header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="<?php bloginfo('name'); ?>">
<?php roots_header_after(); ?> </a>
<nav id="nav-main" role="navigation">
<?php if ($roots_options['clean_menu']) { ?>
<?php wp_nav_menu(array('theme_location' => 'primary_navigation', 'walker' => new roots_nav_walker())); ?>
<?php } else { ?>
<?php wp_nav_menu(array('theme_location' => 'primary_navigation')); ?>
<?php } ?>
</nav>
<?php
$utility_nav = wp_get_nav_menu_object('Utility Navigation');
$utility_nav_term_id = (int) $utility_nav->term_id;
$menu_items = wp_get_nav_menu_items($utility_nav_term_id);
if ($menu_items || !empty($menu_items)) {
?>
<nav id="nav-utility">
<?php if ($roots_options['clean_menu']) { ?>
<?php wp_nav_menu(array('theme_location' => 'utility_navigation', 'walker' => new roots_nav_walker())); ?>
<?php } else { ?>
<?php wp_nav_menu(array('theme_location' => 'utility_navigation')); ?>
<?php } ?>
</nav>
<?php } ?>
</div>
</header>
<?php roots_header_after(); ?>

View File

@@ -1,4 +1,4 @@
<?php <?php
add_action('roots_head', 'roots_google_analytics'); add_action('roots_head', 'roots_google_analytics');
add_action('roots_head', 'roots_fout_b_gone'); add_action('roots_head', 'roots_fout_b_gone');
@@ -12,68 +12,68 @@ add_action('roots_footer_after', 'roots_1140_footer_after');
add_action('roots_post_inside_before', 'roots_page_breadcrumb'); add_action('roots_post_inside_before', 'roots_page_breadcrumb');
function roots_google_analytics() { function roots_google_analytics() {
global $roots_options; global $roots_options;
$roots_google_analytics_id = $roots_options['google_analytics_id']; $roots_google_analytics_id = $roots_options['google_analytics_id'];
$get_roots_google_analytics_id = esc_attr($roots_options['google_analytics_id']); $get_roots_google_analytics_id = esc_attr($roots_options['google_analytics_id']);
if ($roots_google_analytics_id !== '') { if ($roots_google_analytics_id !== '') {
echo "\n\t<script>\n"; echo "\n\t<script>\n";
echo "\t\tvar _gaq=[['_setAccount','$get_roots_google_analytics_id'],['_trackPageview'],['_trackPageLoadTime']];\n"; echo "\t\tvar _gaq=[['_setAccount','$get_roots_google_analytics_id'],['_trackPageview'],['_trackPageLoadTime']];\n";
echo "\t\t(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];\n"; echo "\t\t(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];\n";
echo "\t\tg.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';\n"; echo "\t\tg.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';\n";
echo "\t\ts.parentNode.insertBefore(g,s)}(document,'script'));\n"; echo "\t\ts.parentNode.insertBefore(g,s)}(document,'script'));\n";
echo "\t</script>\n"; echo "\t</script>\n";
} }
} }
function roots_fout_b_gone() { function roots_fout_b_gone() {
global $roots_options; global $roots_options;
$roots_fout_b_gone = $roots_options['fout_b_gone']; $roots_fout_b_gone = $roots_options['fout_b_gone'];
$template_uri = get_template_directory_uri(); $template_uri = get_template_directory_uri();
if ($roots_fout_b_gone === true) { if ($roots_fout_b_gone === true) {
echo "\t<script src=\"$template_uri/js/libs/foutbgone.min.js\"></script>\n"; echo "\t<script src=\"$template_uri/js/libs/foutbgone.min.js\"></script>\n";
echo "\t<script>\n"; echo "\t<script>\n";
echo "\t\tfbg.hideFOUT('asap', 100);\n"; echo "\t\tfbg.hideFOUT('asap', 100);\n";
echo "\t</script>"; echo "\t</script>";
} }
} }
function roots_1140_head() { function roots_1140_head() {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
$template_uri = get_template_directory_uri(); $template_uri = get_template_directory_uri();
if ($roots_css_framework === '1140') { if ($roots_css_framework === '1140') {
echo "\t<script src=\"$template_uri/js/libs/css3-mediaqueries.js\"></script>"; echo "\t<script src=\"$template_uri/js/libs/css3-mediaqueries.js\"></script>";
} }
} }
function roots_adapt_head() { function roots_adapt_head() {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
$template_uri = get_template_directory_uri(); $template_uri = get_template_directory_uri();
if ($roots_css_framework === 'adapt') { if ($roots_css_framework === 'adapt') {
echo "\n\t<script>\n"; echo "\n\t<script>\n";
echo "\t\tvar ADAPT_CONFIG = {\n"; echo "\t\tvar ADAPT_CONFIG = {\n";
echo "\t\t\tpath: '$template_uri/css/adapt/',\n"; echo "\t\t\tpath: '$template_uri/css/adapt/',\n";
echo "\t\t\tdynamic: true,\n"; echo "\t\t\tdynamic: true,\n";
echo "\t\t\trange: [\n"; echo "\t\t\trange: [\n";
echo "\t\t\t\t'0px to 760px = mobile.css',\n"; echo "\t\t\t\t'0px to 760px = mobile.css',\n";
echo "\t\t\t\t'760px to 980px = 720.css',\n"; echo "\t\t\t\t'760px to 980px = 720.css',\n";
echo "\t\t\t\t'980px to 1280px = 960.css',\n"; echo "\t\t\t\t'980px to 1280px = 960.css',\n";
echo "\t\t\t\t'1280px to 1600px = 1200.css',\n"; echo "\t\t\t\t'1280px to 1600px = 1200.css',\n";
echo "\t\t\t\t'1600px to 1920px = 1560.css',\n"; echo "\t\t\t\t'1600px to 1920px = 1560.css',\n";
echo "\t\t\t\t'1920px = fluid.css'\n"; echo "\t\t\t\t'1920px = fluid.css'\n";
echo "\t\t\t]\n"; echo "\t\t\t]\n";
echo "\t\t};\n"; echo "\t\t};\n";
echo "\t</script>\n"; echo "\t</script>\n";
echo "\t<script src=\"$template_uri/js/libs/adapt.min.js\"></script>"; echo "\t<script src=\"$template_uri/js/libs/adapt.min.js\"></script>";
} }
} }
function roots_get_stylesheets() { function roots_get_stylesheets() {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
$styles = ''; $styles = '';
switch ($roots_css_framework) { switch ($roots_css_framework) {
case 'blueprint' : case 'blueprint' :
@@ -102,15 +102,15 @@ function roots_get_stylesheets() {
case 'less' : case 'less' :
$styles .= stylesheet_link_tag('/less/less.css'); $styles .= stylesheet_link_tag('/less/less.css');
break; break;
} }
if (class_exists('RGForms')) { if (class_exists('RGForms')) {
$styles .= "\t<link rel=\"stylesheet\" href=\"" . plugins_url(). "/gravityforms/css/forms.css\">\n"; $styles .= "\t<link rel=\"stylesheet\" href=\"" . plugins_url(). "/gravityforms/css/forms.css\">\n";
} }
if (is_child_theme()) { if (is_child_theme()) {
$styles .= stylesheet_link_tag('/style.css', 1); $styles .= stylesheet_link_tag('/style.css', 1);
$styles .= "\t<link rel=\"stylesheet\" href=\"" . get_stylesheet_uri(). "\">\n"; $styles .= "\t<link rel=\"stylesheet\" href=\"" . get_stylesheet_uri(). "\">\n";
} else { } else {
$styles .= stylesheet_link_tag('/style.css', 1); $styles .= stylesheet_link_tag('/style.css', 1);
} }
@@ -122,9 +122,9 @@ function roots_get_stylesheets() {
case '1140' : case '1140' :
$styles .= "\t<!--[if lt IE 8]>" . stylesheet_link_tag('/1140/ie.css', 0, false) . "<![endif]-->\n"; $styles .= "\t<!--[if lt IE 8]>" . stylesheet_link_tag('/1140/ie.css', 0, false) . "<![endif]-->\n";
break; break;
} }
echo $styles; echo $styles;
} }
function stylesheet_link_tag($file, $tabs = 0, $newline = true) { function stylesheet_link_tag($file, $tabs = 0, $newline = true) {
@@ -133,46 +133,46 @@ function stylesheet_link_tag($file, $tabs = 0, $newline = true) {
} }
function roots_1140_header_before() { function roots_1140_header_before() {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') { if ($roots_css_framework === '1140') {
echo '<div class="container"><div class="row">', "\n"; echo '<div class="container"><div class="row">', "\n";
} }
} }
function roots_1140_header_after() { function roots_1140_header_after() {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') { if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n"; echo "</div></div><!-- /.row /.container -->\n";
echo '<div class="container"><div class="row">', "\n"; echo '<div class="container"><div class="row">', "\n";
} }
} }
function roots_1140_footer_before() { function roots_1140_footer_before() {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') { if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n"; echo "</div></div><!-- /.row /.container -->\n";
echo '<div class="container"><div class="row">', "\n"; echo '<div class="container"><div class="row">', "\n";
} }
} }
function roots_1140_footer_after() { function roots_1140_footer_after() {
global $roots_options; global $roots_options;
$roots_css_framework = $roots_options['css_framework']; $roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') { if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n"; echo "</div></div><!-- /.row /.container -->\n";
} }
} }
function roots_page_breadcrumb() { function roots_page_breadcrumb() {
global $post; global $post;
if (function_exists('yoast_breadcrumb')) { if (function_exists('yoast_breadcrumb')) {
if (is_page() && $post->post_parent) { if (is_page() && $post->post_parent) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>'); yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} }
} }
} }
?> ?>

View File

@@ -5,73 +5,73 @@
global $pagenow; global $pagenow;
if (is_admin() && $pagenow === 'themes.php' && isset( $_GET['activated'])) { if (is_admin() && $pagenow === 'themes.php' && isset( $_GET['activated'])) {
// on theme activation make sure there's a Home page // on theme activation make sure there's a Home page
// create it if there isn't and set the Home page menu order to -1 // create it if there isn't and set the Home page menu order to -1
// set WordPress to have the front page display the Home page as a static page // set WordPress to have the front page display the Home page as a static page
$default_pages = array('Home'); $default_pages = array('Home');
$existing_pages = get_pages(); $existing_pages = get_pages();
$temp = array(); $temp = array();
foreach ($existing_pages as $page) { foreach ($existing_pages as $page) {
$temp[] = $page->post_title; $temp[] = $page->post_title;
} }
$pages_to_create = array_diff($default_pages, $temp); $pages_to_create = array_diff($default_pages, $temp);
foreach ($pages_to_create as $new_page_title) { foreach ($pages_to_create as $new_page_title) {
// create post object // create post object
$add_default_pages = array( $add_default_pages = array(
'post_title' => $new_page_title, 'post_title' => $new_page_title,
'post_content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat, orci ac laoreet cursus, dolor sem luctus lorem, eget consequat magna felis a magna. Aliquam scelerisque condimentum ante, eget facilisis tortor lobortis in. In interdum venenatis justo eget consequat. Morbi commodo rhoncus mi nec pharetra. Aliquam erat volutpat. Mauris non lorem eu dolor hendrerit dapibus. Mauris mollis nisl quis sapien posuere consectetur. Nullam in sapien at nisi ornare bibendum at ut lectus. Pellentesque ut magna mauris. Nam viverra suscipit ligula, sed accumsan enim placerat nec. Cras vitae metus vel dolor ultrices sagittis. Duis venenatis augue sed risus laoreet congue ac ac leo. Donec fermentum accumsan libero sit amet iaculis. Duis tristique dictum enim, ac fringilla risus bibendum in. Nunc ornare, quam sit amet ultricies gravida, tortor mi malesuada urna, quis commodo dui nibh in lacus. Nunc vel tortor mi. Pellentesque vel urna a arcu adipiscing imperdiet vitae sit amet neque. Integer eu lectus et nunc dictum sagittis. Curabitur commodo vulputate fringilla. Sed eleifend, arcu convallis adipiscing congue, dui turpis commodo magna, et vehicula sapien turpis sit amet nisi.', 'post_content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat, orci ac laoreet cursus, dolor sem luctus lorem, eget consequat magna felis a magna. Aliquam scelerisque condimentum ante, eget facilisis tortor lobortis in. In interdum venenatis justo eget consequat. Morbi commodo rhoncus mi nec pharetra. Aliquam erat volutpat. Mauris non lorem eu dolor hendrerit dapibus. Mauris mollis nisl quis sapien posuere consectetur. Nullam in sapien at nisi ornare bibendum at ut lectus. Pellentesque ut magna mauris. Nam viverra suscipit ligula, sed accumsan enim placerat nec. Cras vitae metus vel dolor ultrices sagittis. Duis venenatis augue sed risus laoreet congue ac ac leo. Donec fermentum accumsan libero sit amet iaculis. Duis tristique dictum enim, ac fringilla risus bibendum in. Nunc ornare, quam sit amet ultricies gravida, tortor mi malesuada urna, quis commodo dui nibh in lacus. Nunc vel tortor mi. Pellentesque vel urna a arcu adipiscing imperdiet vitae sit amet neque. Integer eu lectus et nunc dictum sagittis. Curabitur commodo vulputate fringilla. Sed eleifend, arcu convallis adipiscing congue, dui turpis commodo magna, et vehicula sapien turpis sit amet nisi.',
'post_status' => 'publish', 'post_status' => 'publish',
'post_type' => 'page' 'post_type' => 'page'
); );
// insert the post into the database // insert the post into the database
$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');
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);
$home_menu_order = array( $home_menu_order = array(
'ID' => $home->ID, 'ID' => $home->ID,
'menu_order' => -1 'menu_order' => -1
); );
wp_update_post($home_menu_order); wp_update_post($home_menu_order);
// set the permalink structure // set the permalink structure
if (get_option('permalink_structure') !== '/%year%/%postname%/') { if (get_option('permalink_structure') !== '/%year%/%postname%/') {
update_option('permalink_structure', '/%year%/%postname%/'); update_option('permalink_structure', '/%year%/%postname%/');
} }
$wp_rewrite->init(); $wp_rewrite->init();
$wp_rewrite->flush_rules(); $wp_rewrite->flush_rules();
// don't organize uploads by year and month
update_option('uploads_use_yearmonth_folders', 0);
update_option('upload_path', 'assets');
// automatically create menus and set their locations
// add all pages to the Primary Navigation
$roots_nav_theme_mod = false;
if (!has_nav_menu('primary_navigation')) { // don't organize uploads by year and month
$primary_nav_id = wp_create_nav_menu('Primary Navigation', array('slug' => 'primary_navigation')); update_option('uploads_use_yearmonth_folders', 0);
$roots_nav_theme_mod['primary_navigation'] = $primary_nav_id; update_option('upload_path', 'assets');
}
if (!has_nav_menu('utility_navigation')) { // automatically create menus and set their locations
$utility_nav_id = wp_create_nav_menu('Utility Navigation', array('slug' => 'utility_navigation')); // add all pages to the Primary Navigation
$roots_nav_theme_mod['utility_navigation'] = $utility_nav_id; $roots_nav_theme_mod = false;
}
if ($roots_nav_theme_mod) { if (!has_nav_menu('primary_navigation')) {
$primary_nav_id = wp_create_nav_menu('Primary Navigation', array('slug' => 'primary_navigation'));
$roots_nav_theme_mod['primary_navigation'] = $primary_nav_id;
}
if (!has_nav_menu('utility_navigation')) {
$utility_nav_id = wp_create_nav_menu('Utility Navigation', array('slug' => 'utility_navigation'));
$roots_nav_theme_mod['utility_navigation'] = $utility_nav_id;
}
if ($roots_nav_theme_mod) {
set_theme_mod('nav_menu_locations', $roots_nav_theme_mod); set_theme_mod('nav_menu_locations', $roots_nav_theme_mod);
} }
$primary_nav = wp_get_nav_menu_object('Primary Navigation'); $primary_nav = wp_get_nav_menu_object('Primary Navigation');
$primary_nav_term_id = (int) $primary_nav->term_id; $primary_nav_term_id = (int) $primary_nav->term_id;
@@ -91,4 +91,4 @@ if (is_admin() && $pagenow === 'themes.php' && isset( $_GET['activated'])) {
} }
?> ?>

View File

@@ -3,20 +3,20 @@
// redirect /?s to /search/ // redirect /?s to /search/
// http://txfx.net/wordpress-plugins/nice-search/ // http://txfx.net/wordpress-plugins/nice-search/
function roots_nice_search_redirect() { function roots_nice_search_redirect() {
if (is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false) { if (is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false) {
wp_redirect(home_url('/search/' . str_replace(array(' ', '%20'), array('+', '+'), urlencode(get_query_var( 's' )))), 301); wp_redirect(home_url('/search/' . str_replace(array(' ', '%20'), array('+', '+'), urlencode(get_query_var( 's' )))), 301);
exit(); exit();
} }
} }
add_action('template_redirect', 'roots_nice_search_redirect'); add_action('template_redirect', 'roots_nice_search_redirect');
function roots_search_query($escaped = true) { function roots_search_query($escaped = true) {
$query = apply_filters('roots_search_query', get_query_var('s')); $query = apply_filters('roots_search_query', get_query_var('s'));
if ($escaped) { if ($escaped) {
$query = esc_attr($query); $query = esc_attr($query);
} }
return urldecode($query); return urldecode($query);
} }
add_filter('get_search_query', 'roots_search_query'); add_filter('get_search_query', 'roots_search_query');
@@ -25,90 +25,90 @@ add_filter('get_search_query', 'roots_search_query');
// inspired by http://www.456bereastreet.com/archive/201010/how_to_make_wordpress_urls_root_relative/ // inspired by http://www.456bereastreet.com/archive/201010/how_to_make_wordpress_urls_root_relative/
// thanks to Scott Walkinshaw (scottwalkinshaw.com) // thanks to Scott Walkinshaw (scottwalkinshaw.com)
function roots_root_relative_url($input) { function roots_root_relative_url($input) {
$output = preg_replace_callback( $output = preg_replace_callback(
'!(https?://[^/|"]+)([^"]+)?!', '!(https?://[^/|"]+)([^"]+)?!',
create_function( create_function(
'$matches', '$matches',
// if full URL is site_url, return a slash for relative root // if full URL is site_url, return a slash for relative root
'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' . 'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' .
// if domain is equal to site_url, then make URL relative // if domain is equal to site_url, then make URL relative
'} elseif (isset($matches[0]) && strpos($matches[0], site_url()) !== false) { return $matches[2];' . '} elseif (isset($matches[0]) && strpos($matches[0], site_url()) !== false) { return $matches[2];' .
// if domain is not equal to site_url, do not make external link relative // if domain is not equal to site_url, do not make external link relative
'} else { return $matches[0]; };' '} else { return $matches[0]; };'
), ),
$input $input
); );
return $output; return $output;
} }
// Terrible workaround to remove the duplicate subfolder in the src of JS/CSS tags // Terrible workaround to remove the duplicate subfolder in the src of JS/CSS tags
// Example: /subfolder/subfolder/css/style.css // Example: /subfolder/subfolder/css/style.css
function roots_fix_duplicate_subfolder_urls($input) { function roots_fix_duplicate_subfolder_urls($input) {
$output = roots_root_relative_url($input); $output = roots_root_relative_url($input);
preg_match_all('!([^/]+)/([^/]+)!', $output, $matches); preg_match_all('!([^/]+)/([^/]+)!', $output, $matches);
if (isset($matches[1]) && isset($matches[2])) { if (isset($matches[1]) && isset($matches[2])) {
if ($matches[1][0] === $matches[2][0]) { if ($matches[1][0] === $matches[2][0]) {
$output = substr($output, strlen($matches[1][0]) + 1); $output = substr($output, strlen($matches[1][0]) + 1);
} }
} }
return $output; return $output;
} }
$roots_options = roots_get_theme_options(); $roots_options = roots_get_theme_options();
if (!is_admin() && !in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php')) && $roots_options['root_relative_urls']) { if (!is_admin() && !in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php')) && $roots_options['root_relative_urls']) {
add_filter('bloginfo_url', 'roots_root_relative_url'); add_filter('bloginfo_url', 'roots_root_relative_url');
add_filter('theme_root_uri', 'roots_root_relative_url'); add_filter('theme_root_uri', 'roots_root_relative_url');
add_filter('stylesheet_directory_uri', 'roots_root_relative_url'); add_filter('stylesheet_directory_uri', 'roots_root_relative_url');
add_filter('template_directory_uri', 'roots_root_relative_url'); add_filter('template_directory_uri', 'roots_root_relative_url');
add_filter('script_loader_src', 'roots_fix_duplicate_subfolder_urls'); add_filter('script_loader_src', 'roots_fix_duplicate_subfolder_urls');
add_filter('style_loader_src', 'roots_fix_duplicate_subfolder_urls'); add_filter('style_loader_src', 'roots_fix_duplicate_subfolder_urls');
add_filter('plugins_url', 'roots_root_relative_url'); add_filter('plugins_url', 'roots_root_relative_url');
add_filter('the_permalink', 'roots_root_relative_url'); add_filter('the_permalink', 'roots_root_relative_url');
add_filter('wp_list_pages', 'roots_root_relative_url'); add_filter('wp_list_pages', 'roots_root_relative_url');
add_filter('wp_list_categories', 'roots_root_relative_url'); add_filter('wp_list_categories', 'roots_root_relative_url');
add_filter('wp_nav_menu', 'roots_root_relative_url'); add_filter('wp_nav_menu', 'roots_root_relative_url');
add_filter('the_content_more_link', 'roots_root_relative_url'); add_filter('the_content_more_link', 'roots_root_relative_url');
add_filter('the_tags', 'roots_root_relative_url'); add_filter('the_tags', 'roots_root_relative_url');
add_filter('get_pagenum_link', 'roots_root_relative_url'); add_filter('get_pagenum_link', 'roots_root_relative_url');
add_filter('get_comment_link', 'roots_root_relative_url'); add_filter('get_comment_link', 'roots_root_relative_url');
add_filter('month_link', 'roots_root_relative_url'); add_filter('month_link', 'roots_root_relative_url');
add_filter('day_link', 'roots_root_relative_url'); add_filter('day_link', 'roots_root_relative_url');
add_filter('year_link', 'roots_root_relative_url'); add_filter('year_link', 'roots_root_relative_url');
add_filter('tag_link', 'roots_root_relative_url'); add_filter('tag_link', 'roots_root_relative_url');
add_filter('the_author_posts_link', 'roots_root_relative_url'); add_filter('the_author_posts_link', 'roots_root_relative_url');
} }
// remove root relative URLs on any attachments in the feed // remove root relative URLs on any attachments in the feed
function roots_root_relative_attachment_urls() { function roots_root_relative_attachment_urls() {
$roots_options = roots_get_theme_options(); $roots_options = roots_get_theme_options();
if (!is_feed() && $roots_options['root_relative_urls']) { if (!is_feed() && $roots_options['root_relative_urls']) {
add_filter('wp_get_attachment_url', 'roots_root_relative_url'); add_filter('wp_get_attachment_url', 'roots_root_relative_url');
add_filter('wp_get_attachment_link', 'roots_root_relative_url'); add_filter('wp_get_attachment_link', 'roots_root_relative_url');
} }
} }
add_action('pre_get_posts', 'roots_root_relative_attachment_urls'); add_action('pre_get_posts', 'roots_root_relative_attachment_urls');
// set lang="en" as default (rather than en-US) // set lang="en" as default (rather than en-US)
function roots_language_attributes() { function roots_language_attributes() {
$attributes = array(); $attributes = array();
$output = ''; $output = '';
if (function_exists('is_rtl')) { if (function_exists('is_rtl')) {
if (is_rtl() == 'rtl') { if (is_rtl() == 'rtl') {
$attributes[] = 'dir="rtl"'; $attributes[] = 'dir="rtl"';
} }
} }
$lang = get_bloginfo('language');
if ($lang && $lang !== 'en-US') {
$attributes[] = "lang=\"$lang\"";
} else {
$attributes[] = 'lang="en"';
}
$output = implode(' ', $attributes); $lang = get_bloginfo('language');
$output = apply_filters('roots_language_attributes', $output); if ($lang && $lang !== 'en-US') {
return $output; $attributes[] = "lang=\"$lang\"";
} else {
$attributes[] = 'lang="en"';
}
$output = implode(' ', $attributes);
$output = apply_filters('roots_language_attributes', $output);
return $output;
} }
add_filter('language_attributes', 'roots_language_attributes'); add_filter('language_attributes', 'roots_language_attributes');
@@ -119,173 +119,173 @@ add_filter('the_generator', 'roots_no_generator');
// cleanup wp_head // cleanup wp_head
function roots_noindex() { function roots_noindex() {
if (get_option('blog_public') === '0') { if (get_option('blog_public') === '0') {
echo '<meta name="robots" content="noindex,nofollow">', "\n"; echo '<meta name="robots" content="noindex,nofollow">', "\n";
} }
} }
function roots_rel_canonical() { function roots_rel_canonical() {
if (!is_singular()) { if (!is_singular()) {
return; return;
} }
global $wp_the_query; global $wp_the_query;
if (!$id = $wp_the_query->get_queried_object_id()) { if (!$id = $wp_the_query->get_queried_object_id()) {
return; return;
} }
$link = get_permalink($id); $link = get_permalink($id);
echo "\t<link rel=\"canonical\" href=\"$link\">\n"; echo "\t<link rel=\"canonical\" href=\"$link\">\n";
} }
// remove CSS from recent comments widget // remove CSS from recent comments widget
function roots_remove_recent_comments_style() { function roots_remove_recent_comments_style() {
global $wp_widget_factory; global $wp_widget_factory;
if (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) { if (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) {
remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style')); remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style'));
} }
} }
// remove CSS from gallery // remove CSS from gallery
function roots_gallery_style($css) { function roots_gallery_style($css) {
return preg_replace("!<style type='text/css'>(.*?)</style>!s", '', $css); return preg_replace("!<style type='text/css'>(.*?)</style>!s", '', $css);
} }
function roots_head_cleanup() { function roots_head_cleanup() {
// http://wpengineer.com/1438/wordpress-header/ // http://wpengineer.com/1438/wordpress-header/
remove_action('wp_head', 'feed_links', 2); remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3); remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'parent_post_rel_link', 10, 0); remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'start_post_rel_link', 10, 0); remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action('wp_head', 'noindex', 1); remove_action('wp_head', 'noindex', 1);
add_action('wp_head', 'roots_noindex'); add_action('wp_head', 'roots_noindex');
remove_action('wp_head', 'rel_canonical'); remove_action('wp_head', 'rel_canonical');
add_action('wp_head', 'roots_rel_canonical'); add_action('wp_head', 'roots_rel_canonical');
add_action('wp_head', 'roots_remove_recent_comments_style', 1); add_action('wp_head', 'roots_remove_recent_comments_style', 1);
add_filter('gallery_style', 'roots_gallery_style'); add_filter('gallery_style', 'roots_gallery_style');
// stop Gravity Forms from outputting CSS since it's linked in header.php
if (class_exists('RGForms')) {
update_option('rg_gforms_disable_css', 1);
}
// deregister l10n.js (new since WordPress 3.1) // stop Gravity Forms from outputting CSS since it's linked in header.php
// why you might want to keep it: http://wordpress.stackexchange.com/questions/5451/what-does-l10n-js-do-in-wordpress-3-1-and-how-do-i-remove-it/5484#5484 if (class_exists('RGForms')) {
// don't load jQuery through WordPress since it's linked in header.php update_option('rg_gforms_disable_css', 1);
if (!is_admin()) { }
wp_deregister_script('l10n');
wp_deregister_script('jquery'); // deregister l10n.js (new since WordPress 3.1)
wp_register_script('jquery', '', '', '', true); // why you might want to keep it: http://wordpress.stackexchange.com/questions/5451/what-does-l10n-js-do-in-wordpress-3-1-and-how-do-i-remove-it/5484#5484
} // don't load jQuery through WordPress since it's linked in header.php
if (!is_admin()) {
wp_deregister_script('l10n');
wp_deregister_script('jquery');
wp_register_script('jquery', '', '', '', true);
}
} }
add_action('init', 'roots_head_cleanup'); add_action('init', 'roots_head_cleanup');
// cleanup gallery_shortcode() // cleanup gallery_shortcode()
function roots_gallery_shortcode($attr) { function roots_gallery_shortcode($attr) {
global $post, $wp_locale; global $post, $wp_locale;
static $instance = 0; static $instance = 0;
$instance++; $instance++;
// Allow plugins/themes to override the default gallery template. // Allow plugins/themes to override the default gallery template.
$output = apply_filters('post_gallery', '', $attr); $output = apply_filters('post_gallery', '', $attr);
if ( $output != '' ) if ( $output != '' )
return $output; return $output;
// We're trusting author input, so let's at least make sure it looks like a valid orderby statement // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
if ( isset( $attr['orderby'] ) ) { if ( isset( $attr['orderby'] ) ) {
$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
if ( !$attr['orderby'] ) if ( !$attr['orderby'] )
unset( $attr['orderby'] ); unset( $attr['orderby'] );
} }
extract(shortcode_atts(array( extract(shortcode_atts(array(
'order' => 'ASC', 'order' => 'ASC',
'orderby' => 'menu_order ID', 'orderby' => 'menu_order ID',
'id' => $post->ID, 'id' => $post->ID,
'icontag' => 'figure', 'icontag' => 'figure',
'captiontag' => 'figcaption', 'captiontag' => 'figcaption',
'columns' => 3, 'columns' => 3,
'size' => 'thumbnail', 'size' => 'thumbnail',
'include' => '', 'include' => '',
'exclude' => '' 'exclude' => ''
), $attr)); ), $attr));
$id = intval($id); $id = intval($id);
if ( 'RAND' == $order ) if ( 'RAND' == $order )
$orderby = 'none'; $orderby = 'none';
if ( !empty($include) ) { if ( !empty($include) ) {
$include = preg_replace( '/[^0-9,]+/', '', $include ); $include = preg_replace( '/[^0-9,]+/', '', $include );
$_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
$attachments = array(); $attachments = array();
foreach ( $_attachments as $key => $val ) { foreach ( $_attachments as $key => $val ) {
$attachments[$val->ID] = $_attachments[$key]; $attachments[$val->ID] = $_attachments[$key];
} }
} elseif ( !empty($exclude) ) { } elseif ( !empty($exclude) ) {
$exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
$attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
} else { } else {
$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
} }
if ( empty($attachments) ) if ( empty($attachments) )
return ''; return '';
if ( is_feed() ) { if ( is_feed() ) {
$output = "\n"; $output = "\n";
foreach ( $attachments as $att_id => $attachment ) foreach ( $attachments as $att_id => $attachment )
$output .= wp_get_attachment_link($att_id, $size, true) . "\n"; $output .= wp_get_attachment_link($att_id, $size, true) . "\n";
return $output; return $output;
} }
$captiontag = tag_escape($captiontag); $captiontag = tag_escape($captiontag);
$columns = intval($columns); $columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100; $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
$float = is_rtl() ? 'right' : 'left'; $float = is_rtl() ? 'right' : 'left';
$selector = "gallery-{$instance}"; $selector = "gallery-{$instance}";
$gallery_style = $gallery_div = ''; $gallery_style = $gallery_div = '';
if ( apply_filters( 'use_default_gallery_style', true ) ) if ( apply_filters( 'use_default_gallery_style', true ) )
$gallery_style = ""; $gallery_style = "";
$size_class = sanitize_html_class( $size ); $size_class = sanitize_html_class( $size );
$gallery_div = "<section id='$selector' class='clearfix gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>"; $gallery_div = "<section id='$selector' class='clearfix gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
$output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div ); $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );
$i = 0; $i = 0;
foreach ( $attachments as $id => $attachment ) { foreach ( $attachments as $id => $attachment ) {
// make the gallery link to the file by default instead of the attachment // make the gallery link to the file by default instead of the attachment
// thanks to Matt Price (countingrows.com) // thanks to Matt Price (countingrows.com)
$link = isset($attr['link']) && $attr['link'] === 'attachment' ? $link = isset($attr['link']) && $attr['link'] === 'attachment' ?
wp_get_attachment_link($id, $size, true, false) : wp_get_attachment_link($id, $size, true, false) :
wp_get_attachment_link($id, $size, false, false); wp_get_attachment_link($id, $size, false, false);
$output .= " $output .= "
<{$icontag} class=\"gallery-item\"> <{$icontag} class=\"gallery-item\">
$link $link
"; ";
if ( $captiontag && trim($attachment->post_excerpt) ) { if ( $captiontag && trim($attachment->post_excerpt) ) {
$output .= " $output .= "
<{$captiontag} class=\"gallery-caption\"> <{$captiontag} class=\"gallery-caption\">
" . wptexturize($attachment->post_excerpt) . " " . wptexturize($attachment->post_excerpt) . "
</{$captiontag}>"; </{$captiontag}>";
} }
$output .= "</{$icontag}>"; $output .= "</{$icontag}>";
if ( $columns > 0 && ++$i % $columns == 0 ) if ( $columns > 0 && ++$i % $columns == 0 )
$output .= ''; $output .= '';
} }
$output .= "</section>\n"; $output .= "</section>\n";
return $output; return $output;
} }
remove_shortcode('gallery'); remove_shortcode('gallery');
@@ -293,21 +293,21 @@ add_shortcode('gallery', 'roots_gallery_shortcode');
// http://www.deluxeblogtips.com/2011/01/remove-dashboard-widgets-in-wordpress.html // http://www.deluxeblogtips.com/2011/01/remove-dashboard-widgets-in-wordpress.html
function roots_remove_dashboard_widgets() { function roots_remove_dashboard_widgets() {
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
remove_meta_box('dashboard_primary', 'dashboard', 'normal'); remove_meta_box('dashboard_primary', 'dashboard', 'normal');
remove_meta_box('dashboard_secondary', 'dashboard', 'normal'); remove_meta_box('dashboard_secondary', 'dashboard', 'normal');
} }
add_action('admin_init', 'roots_remove_dashboard_widgets'); add_action('admin_init', 'roots_remove_dashboard_widgets');
// excerpt cleanup // excerpt cleanup
function roots_excerpt_length($length) { function roots_excerpt_length($length) {
return 40; return 40;
} }
function roots_excerpt_more($more) { function roots_excerpt_more($more) {
return ' &hellip; <a href="' . get_permalink() . '">' . __( 'Continued', 'roots' ) . '</a>'; return ' &hellip; <a href="' . get_permalink() . '">' . __( 'Continued', 'roots' ) . '</a>';
} }
add_filter('excerpt_length', 'roots_excerpt_length'); add_filter('excerpt_length', 'roots_excerpt_length');
@@ -315,72 +315,72 @@ add_filter('excerpt_more', 'roots_excerpt_more');
// remove container from menus // remove container from menus
function roots_nav_menu_args($args = '') { function roots_nav_menu_args($args = '') {
$args['container'] = false; $args['container'] = false;
return $args; return $args;
} }
add_filter('wp_nav_menu_args', 'roots_nav_menu_args'); add_filter('wp_nav_menu_args', 'roots_nav_menu_args');
class roots_nav_walker extends Walker_Nav_Menu { class roots_nav_walker extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) { function start_el(&$output, $item, $depth, $args) {
global $wp_query; global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$slug = sanitize_title($item->title); $slug = sanitize_title($item->title);
$class_names = $value = ''; $class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes; $classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes = array_filter($classes, 'roots_check_current'); $classes = array_filter($classes, 'roots_check_current');
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
$id = apply_filters( 'nav_menu_item_id', 'menu-' . $slug, $item, $args ); $id = apply_filters( 'nav_menu_item_id', 'menu-' . $slug, $item, $args );
$id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : ''; $id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
$output .= $indent . '<li' . $id . $class_names . '>'; $output .= $indent . '<li' . $id . $class_names . '>';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : ''; $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : ''; $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : ''; $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : ''; $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$item_output = $args->before; $item_output = $args->before;
$item_output .= '<a'. $attributes .'>'; $item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '</a>'; $item_output .= '</a>';
$item_output .= $args->after; $item_output .= $args->after;
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
} }
} }
function roots_check_current($val) { function roots_check_current($val) {
return preg_match('/current-menu/', $val); return preg_match('/current-menu/', $val);
} }
// add to robots.txt // add to robots.txt
// http://codex.wordpress.org/Search_Engine_Optimization_for_WordPress#Robots.txt_Optimization // http://codex.wordpress.org/Search_Engine_Optimization_for_WordPress#Robots.txt_Optimization
function roots_robots() { function roots_robots() {
echo "Disallow: /cgi-bin\n"; echo "Disallow: /cgi-bin\n";
echo "Disallow: /wp-admin\n"; echo "Disallow: /wp-admin\n";
echo "Disallow: /wp-includes\n"; echo "Disallow: /wp-includes\n";
echo "Disallow: /wp-content/plugins\n"; echo "Disallow: /wp-content/plugins\n";
echo "Disallow: /plugins\n"; echo "Disallow: /plugins\n";
echo "Disallow: /wp-content/cache\n"; echo "Disallow: /wp-content/cache\n";
echo "Disallow: /wp-content/themes\n"; echo "Disallow: /wp-content/themes\n";
echo "Disallow: /trackback\n"; echo "Disallow: /trackback\n";
echo "Disallow: /feed\n"; echo "Disallow: /feed\n";
echo "Disallow: /comments\n"; echo "Disallow: /comments\n";
echo "Disallow: /category/*/*\n"; echo "Disallow: /category/*/*\n";
echo "Disallow: */trackback\n"; echo "Disallow: */trackback\n";
echo "Disallow: */feed\n"; echo "Disallow: */feed\n";
echo "Disallow: */comments\n"; echo "Disallow: */comments\n";
echo "Disallow: /*?*\n"; echo "Disallow: /*?*\n";
echo "Disallow: /*?\n"; echo "Disallow: /*?\n";
echo "Allow: /wp-content/uploads\n"; echo "Allow: /wp-content/uploads\n";
echo "Allow: /assets"; echo "Allow: /assets";
} }
add_action('do_robots', 'roots_robots'); add_action('do_robots', 'roots_robots');
@@ -388,7 +388,7 @@ add_action('do_robots', 'roots_robots');
// we don't need to self-close these tags in html5: // we don't need to self-close these tags in html5:
// <img>, <input> // <img>, <input>
function roots_remove_self_closing_tags($input) { function roots_remove_self_closing_tags($input) {
return str_replace(' />', '>', $input); return str_replace(' />', '>', $input);
} }
add_filter('get_avatar', 'roots_remove_self_closing_tags'); add_filter('get_avatar', 'roots_remove_self_closing_tags');
@@ -400,23 +400,23 @@ add_filter('post_thumbnail_html', 'roots_remove_self_closing_tags');
// you want to change this or remove it because it's used as the description in the RSS feed // you want to change this or remove it because it's used as the description in the RSS feed
function roots_notice_tagline() { function roots_notice_tagline() {
global $current_user; global $current_user;
$user_id = $current_user->ID; $user_id = $current_user->ID;
if (!get_user_meta($user_id, 'ignore_tagline_notice')) { if (!get_user_meta($user_id, 'ignore_tagline_notice')) {
echo '<div class="error">'; echo '<div class="error">';
echo '<p>', sprintf(__('Please update your <a href="%s">site tagline</a> <a href="%s" style="float: right;">Hide Notice</a>', 'roots'), admin_url('options-general.php'), '?tagline_notice_ignore=0'), '</p>'; echo '<p>', sprintf(__('Please update your <a href="%s">site tagline</a> <a href="%s" style="float: right;">Hide Notice</a>', 'roots'), admin_url('options-general.php'), '?tagline_notice_ignore=0'), '</p>';
echo '</div>'; echo '</div>';
} }
} }
if (get_option('blogdescription') === 'Just another WordPress site') { if (get_option('blogdescription') === 'Just another WordPress site') {
add_action('admin_notices', 'roots_notice_tagline'); add_action('admin_notices', 'roots_notice_tagline');
} }
function roots_notice_tagline_ignore() { function roots_notice_tagline_ignore() {
global $current_user; global $current_user;
$user_id = $current_user->ID; $user_id = $current_user->ID;
if (isset($_GET['tagline_notice_ignore']) && '0' == $_GET['tagline_notice_ignore']) { if (isset($_GET['tagline_notice_ignore']) && '0' == $_GET['tagline_notice_ignore']) {
add_user_meta($user_id, 'ignore_tagline_notice', 'true', true); add_user_meta($user_id, 'ignore_tagline_notice', 'true', true);
} }
} }
@@ -428,13 +428,13 @@ if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 5);
// allow more tags in TinyMCE including iframes // allow more tags in TinyMCE including iframes
function roots_change_mce_options($options) { function roots_change_mce_options($options) {
$ext = 'pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]'; $ext = 'pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]';
if (isset($initArray['extended_valid_elements'])) { if (isset($initArray['extended_valid_elements'])) {
$options['extended_valid_elements'] .= ',' . $ext; $options['extended_valid_elements'] .= ',' . $ext;
} else { } else {
$options['extended_valid_elements'] = $ext; $options['extended_valid_elements'] = $ext;
} }
return $options; return $options;
} }
add_filter('tiny_mce_before_init', 'roots_change_mce_options'); add_filter('tiny_mce_before_init', 'roots_change_mce_options');
@@ -445,60 +445,60 @@ add_filter('style_loader_tag', 'roots_clean_style_tag');
function roots_clean_style_tag($input) { function roots_clean_style_tag($input) {
preg_match_all("!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches); preg_match_all("!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches);
//only display media if it's print //only display media if it's print
$media = $matches[3][0] === 'print' ? ' media="print"' : ''; $media = $matches[3][0] === 'print' ? ' media="print"' : '';
return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n"; return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n";
} }
function roots_body_class() { function roots_body_class() {
$term = get_queried_object(); $term = get_queried_object();
if (is_single()) if (is_single())
$cat = get_the_category(); $cat = get_the_category();
if(!empty($cat)) if(!empty($cat))
return $cat[0]->slug; return $cat[0]->slug;
elseif(isset($term->slug)) elseif(isset($term->slug))
return $term->slug; return $term->slug;
elseif(isset($term->page_name)) elseif(isset($term->page_name))
return $term->page_name; return $term->page_name;
elseif(isset($term->post_name)) elseif(isset($term->post_name))
return $term->post_name; return $term->post_name;
else else
return; return;
} }
// first and last classes for widgets // first and last classes for widgets
// http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets // http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets
function roots_widget_first_last_classes($params) { function roots_widget_first_last_classes($params) {
global $my_widget_num; global $my_widget_num;
$this_id = $params[0]['id']; $this_id = $params[0]['id'];
$arr_registered_widgets = wp_get_sidebars_widgets(); $arr_registered_widgets = wp_get_sidebars_widgets();
if (!$my_widget_num) { if (!$my_widget_num) {
$my_widget_num = array(); $my_widget_num = array();
} }
if (!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { if (!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) {
return $params; return $params;
} }
if (isset($my_widget_num[$this_id])) { if (isset($my_widget_num[$this_id])) {
$my_widget_num[$this_id] ++; $my_widget_num[$this_id] ++;
} else { } else {
$my_widget_num[$this_id] = 1; $my_widget_num[$this_id] = 1;
} }
$class = 'class="widget-' . $my_widget_num[$this_id] . ' '; $class = 'class="widget-' . $my_widget_num[$this_id] . ' ';
if ($my_widget_num[$this_id] == 1) { if ($my_widget_num[$this_id] == 1) {
$class .= 'widget-first '; $class .= 'widget-first ';
} elseif ($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { } elseif ($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) {
$class .= 'widget-last '; $class .= 'widget-last ';
} }
$params[0]['before_widget'] = str_replace('class="', $class, $params[0]['before_widget']); $params[0]['before_widget'] = str_replace('class="', $class, $params[0]['before_widget']);
return $params; return $params;
} }
add_filter('dynamic_sidebar_params', 'roots_widget_first_last_classes'); add_filter('dynamic_sidebar_params', 'roots_widget_first_last_classes');
?> ?>

View File

@@ -1,34 +1,34 @@
<?php <?php
// header.php // header.php
function roots_head() { do_action('roots_head'); } function roots_head() { do_action('roots_head'); }
function roots_stylesheets() { do_action('roots_stylesheets'); } function roots_stylesheets() { do_action('roots_stylesheets'); }
function roots_wrap_before() { do_action('roots_wrap_before'); } function roots_wrap_before() { do_action('roots_wrap_before'); }
function roots_header_before() { do_action('roots_header_before'); } function roots_header_before() { do_action('roots_header_before'); }
function roots_header_inside() { do_action('roots_header_inside'); } function roots_header_inside() { do_action('roots_header_inside'); }
function roots_header_after() { do_action('roots_header_after'); } function roots_header_after() { do_action('roots_header_after'); }
// 404.php, archive.php, front-page.php, index.php, loop-page.php, loop-search.php, loop-single.php, loop.php // 404.php, archive.php, front-page.php, index.php, loop-page.php, loop-search.php, loop-single.php, loop.php
// page-custom.php, page-full.php, page-sitemap.php, page-subpages.php, page.php, search.php, single.php // page-custom.php, page-full.php, page-sitemap.php, page-subpages.php, page.php, search.php, single.php
function roots_content_before() { do_action('roots_content_before'); } function roots_content_before() { do_action('roots_content_before'); }
function roots_content_after() { do_action('roots_content_after'); } function roots_content_after() { do_action('roots_content_after'); }
function roots_main_before() { do_action('roots_main_before'); } function roots_main_before() { do_action('roots_main_before'); }
function roots_main_after() { do_action('roots_main_after'); } function roots_main_after() { do_action('roots_main_after'); }
function roots_post_before() { do_action('roots_post_before'); } function roots_post_before() { do_action('roots_post_before'); }
function roots_post_after() { do_action('roots_post_after'); } function roots_post_after() { do_action('roots_post_after'); }
function roots_post_inside_before() { do_action('roots_post_inside_before'); } function roots_post_inside_before() { do_action('roots_post_inside_before'); }
function roots_post_inside_after() { do_action('roots_post_inside_after'); } function roots_post_inside_after() { do_action('roots_post_inside_after'); }
function roots_loop_before() { do_action('roots_loop_before'); } function roots_loop_before() { do_action('roots_loop_before'); }
function roots_loop_after() { do_action('roots_loop_after'); } function roots_loop_after() { do_action('roots_loop_after'); }
function roots_sidebar_before() { do_action('roots_sidebar_before'); } function roots_sidebar_before() { do_action('roots_sidebar_before'); }
function roots_sidebar_inside_before() { do_action('roots_sidebar_inside_before'); } function roots_sidebar_inside_before() { do_action('roots_sidebar_inside_before'); }
function roots_sidebar_inside_after() { do_action('roots_sidebar_inside_after'); } function roots_sidebar_inside_after() { do_action('roots_sidebar_inside_after'); }
function roots_sidebar_after() { do_action('roots_sidebar_after'); } function roots_sidebar_after() { do_action('roots_sidebar_after'); }
// footer.php // footer.php
function roots_footer_before() { do_action('roots_footer_before'); } function roots_footer_before() { do_action('roots_footer_before'); }
function roots_footer_inside() { do_action('roots_footer_inside'); } function roots_footer_inside() { do_action('roots_footer_inside'); }
function roots_footer_after() { do_action('roots_footer_after'); } function roots_footer_after() { do_action('roots_footer_after'); }
function roots_footer() { do_action('roots_footer'); } function roots_footer() { do_action('roots_footer'); }
?> ?>

View File

@@ -5,82 +5,82 @@
// https://github.com/retlehs/roots/wiki/Lighttpd // https://github.com/retlehs/roots/wiki/Lighttpd
if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') !== false) { if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') !== false) {
function roots_htaccess_writable() { function roots_htaccess_writable() {
if (!is_writable(get_home_path() . '.htaccess')) { if (!is_writable(get_home_path() . '.htaccess')) {
if (current_user_can('administrator')) { if (current_user_can('administrator')) {
add_action('admin_notices', create_function('', "echo '<div class=\"error\"><p>" . sprintf(__('Please make sure your <a href="%s">.htaccess</a> file is writable ', 'roots'), admin_url('options-permalink.php')) . "</p></div>';")); add_action('admin_notices', create_function('', "echo '<div class=\"error\"><p>" . sprintf(__('Please make sure your <a href="%s">.htaccess</a> file is writable ', 'roots'), admin_url('options-permalink.php')) . "</p></div>';"));
} }
}; };
} }
add_action('admin_init', 'roots_htaccess_writable'); add_action('admin_init', 'roots_htaccess_writable');
// Rewrites DO NOT happen for child themes // Rewrites DO NOT happen for child themes
// rewrite /wp-content/themes/roots/css/ to /css/ // rewrite /wp-content/themes/roots/css/ to /css/
// rewrite /wp-content/themes/roots/js/ to /js/ // rewrite /wp-content/themes/roots/js/ to /js/
// rewrite /wp-content/themes/roots/img/ to /js/ // rewrite /wp-content/themes/roots/img/ to /js/
// rewrite /wp-content/plugins/ to /plugins/ // rewrite /wp-content/plugins/ to /plugins/
function roots_flush_rewrites() { function roots_flush_rewrites() {
global $wp_rewrite; global $wp_rewrite;
$wp_rewrite->flush_rules(); $wp_rewrite->flush_rules();
} }
function roots_add_rewrites($content) { function roots_add_rewrites($content) {
$theme_name = next(explode('/themes/', get_stylesheet_directory())); $theme_name = next(explode('/themes/', get_stylesheet_directory()));
global $wp_rewrite; global $wp_rewrite;
$roots_new_non_wp_rules = array( $roots_new_non_wp_rules = array(
'css/(.*)' => 'wp-content/themes/'. $theme_name . '/css/$1', 'css/(.*)' => 'wp-content/themes/'. $theme_name . '/css/$1',
'js/(.*)' => 'wp-content/themes/'. $theme_name . '/js/$1', 'js/(.*)' => 'wp-content/themes/'. $theme_name . '/js/$1',
'img/(.*)' => 'wp-content/themes/'. $theme_name . '/img/$1', 'img/(.*)' => 'wp-content/themes/'. $theme_name . '/img/$1',
'plugins/(.*)' => 'wp-content/plugins/$1' 'plugins/(.*)' => 'wp-content/plugins/$1'
); );
$wp_rewrite->non_wp_rules += $roots_new_non_wp_rules; $wp_rewrite->non_wp_rules += $roots_new_non_wp_rules;
} }
add_action('admin_init', 'roots_flush_rewrites'); add_action('admin_init', 'roots_flush_rewrites');
function roots_clean_assets($content) { function roots_clean_assets($content) {
$theme_name = next(explode('/themes/', $content)); $theme_name = next(explode('/themes/', $content));
$current_path = '/wp-content/themes/' . $theme_name; $current_path = '/wp-content/themes/' . $theme_name;
$new_path = ''; $new_path = '';
$content = str_replace($current_path, $new_path, $content); $content = str_replace($current_path, $new_path, $content);
return $content; return $content;
} }
function roots_clean_plugins($content) { function roots_clean_plugins($content) {
$current_path = '/wp-content/plugins'; $current_path = '/wp-content/plugins';
$new_path = '/plugins'; $new_path = '/plugins';
$content = str_replace($current_path, $new_path, $content); $content = str_replace($current_path, $new_path, $content);
return $content; return $content;
} }
// only use clean urls if the theme isn't a child or an MU (Network) install // only use clean urls if the theme isn't a child or an MU (Network) install
if (!is_multisite() && !is_child_theme()) { if (!is_multisite() && !is_child_theme()) {
add_action('generate_rewrite_rules', 'roots_add_rewrites'); add_action('generate_rewrite_rules', 'roots_add_rewrites');
if (!is_admin()) { if (!is_admin()) {
add_filter('plugins_url', 'roots_clean_plugins'); add_filter('plugins_url', 'roots_clean_plugins');
add_filter('bloginfo', 'roots_clean_assets'); add_filter('bloginfo', 'roots_clean_assets');
add_filter('stylesheet_directory_uri', 'roots_clean_assets'); add_filter('stylesheet_directory_uri', 'roots_clean_assets');
add_filter('template_directory_uri', 'roots_clean_assets'); add_filter('template_directory_uri', 'roots_clean_assets');
add_filter('script_loader_src', 'roots_clean_plugins'); add_filter('script_loader_src', 'roots_clean_plugins');
add_filter('style_loader_src', 'roots_clean_plugins'); add_filter('style_loader_src', 'roots_clean_plugins');
} }
} }
function roots_add_h5bp_htaccess($rules) { function roots_add_h5bp_htaccess($rules) {
global $wp_filesystem; global $wp_filesystem;
if (!defined('FS_METHOD')) define('FS_METHOD', 'direct'); if (!defined('FS_METHOD')) define('FS_METHOD', 'direct');
if (is_null($wp_filesystem)) WP_Filesystem(array(), ABSPATH); if (is_null($wp_filesystem)) WP_Filesystem(array(), ABSPATH);
$filename = __DIR__ . '/h5bp-htaccess'; $filename = __DIR__ . '/h5bp-htaccess';
$rules .= $wp_filesystem->get_contents($filename); $rules .= $wp_filesystem->get_contents($filename);
return $rules; return $rules;
} }
add_action('mod_rewrite_rules', 'roots_add_h5bp_htaccess'); add_action('mod_rewrite_rules', 'roots_add_h5bp_htaccess');
} }
?> ?>

View File

@@ -1,323 +1,323 @@
<?php <?php
function roots_admin_enqueue_scripts($hook_suffix) { function roots_admin_enqueue_scripts($hook_suffix) {
if ($hook_suffix !== 'appearance_page_theme_options') if ($hook_suffix !== 'appearance_page_theme_options')
return; return;
wp_enqueue_style('roots-theme-options', get_template_directory_uri() . '/inc/css/theme-options.css'); wp_enqueue_style('roots-theme-options', get_template_directory_uri() . '/inc/css/theme-options.css');
wp_enqueue_script('roots-theme-options', get_template_directory_uri() . '/inc/js/theme-options.js'); wp_enqueue_script('roots-theme-options', get_template_directory_uri() . '/inc/js/theme-options.js');
} }
add_action('admin_enqueue_scripts', 'roots_admin_enqueue_scripts'); add_action('admin_enqueue_scripts', 'roots_admin_enqueue_scripts');
function roots_theme_options_init() { function roots_theme_options_init() {
if (false === roots_get_theme_options()) if (false === roots_get_theme_options())
add_option('roots_theme_options', roots_get_default_theme_options()); add_option('roots_theme_options', roots_get_default_theme_options());
register_setting( register_setting(
'roots_options', 'roots_options',
'roots_theme_options', 'roots_theme_options',
'roots_theme_options_validate' 'roots_theme_options_validate'
); );
} }
add_action('admin_init', 'roots_theme_options_init'); add_action('admin_init', 'roots_theme_options_init');
function roots_option_page_capability($capability) { function roots_option_page_capability($capability) {
return 'edit_theme_options'; return 'edit_theme_options';
} }
add_filter('option_page_capability_roots_options', 'roots_option_page_capability'); add_filter('option_page_capability_roots_options', 'roots_option_page_capability');
function roots_theme_options_add_page() { function roots_theme_options_add_page() {
$theme_page = add_theme_page( $theme_page = add_theme_page(
__('Theme Options', 'roots'), __('Theme Options', 'roots'),
__('Theme Options', 'roots'), __('Theme Options', 'roots'),
'edit_theme_options', 'edit_theme_options',
'theme_options', 'theme_options',
'roots_theme_options_render_page' 'roots_theme_options_render_page'
); );
if (!$theme_page) if (!$theme_page)
return; return;
} }
add_action('admin_menu', 'roots_theme_options_add_page'); add_action('admin_menu', 'roots_theme_options_add_page');
function roots_admin_bar_render() { function roots_admin_bar_render() {
global $wp_admin_bar; global $wp_admin_bar;
$wp_admin_bar->add_menu(array( $wp_admin_bar->add_menu(array(
'parent' => 'appearance', 'parent' => 'appearance',
'id' => 'theme_options', 'id' => 'theme_options',
'title' => __('Theme Options', 'roots'), 'title' => __('Theme Options', 'roots'),
'href' => admin_url( 'themes.php?page=theme_options') 'href' => admin_url( 'themes.php?page=theme_options')
)); ));
} }
add_action('wp_before_admin_bar_render', 'roots_admin_bar_render'); add_action('wp_before_admin_bar_render', 'roots_admin_bar_render');
global $roots_css_frameworks; global $roots_css_frameworks;
$roots_css_frameworks = array( $roots_css_frameworks = array(
'blueprint' => array( 'blueprint' => array(
'name' => 'blueprint', 'name' => 'blueprint',
'label' => __('Blueprint CSS', 'roots'), 'label' => __('Blueprint CSS', 'roots'),
'classes' => array( 'classes' => array(
'container' => 'span-24', 'container' => 'span-24',
'main' => 'span-14 append-1', 'main' => 'span-14 append-1',
'sidebar' => 'span-8 prepend-1 last' 'sidebar' => 'span-8 prepend-1 last'
) )
), ),
'960gs_12' => array( '960gs_12' => array(
'name' => '960gs_12', 'name' => '960gs_12',
'label' => __('960gs (12 cols)', 'roots'), 'label' => __('960gs (12 cols)', 'roots'),
'classes' => array( 'classes' => array(
'container' => 'container_12', 'container' => 'container_12',
'main' => 'grid_7 suffix_1', 'main' => 'grid_7 suffix_1',
'sidebar' => 'grid_4' 'sidebar' => 'grid_4'
) )
), ),
'960gs_16' => array( '960gs_16' => array(
'name' => '960gs_16', 'name' => '960gs_16',
'label' => __('960gs (16 cols)', 'roots'), 'label' => __('960gs (16 cols)', 'roots'),
'classes' => array( 'classes' => array(
'container' => 'container_16', 'container' => 'container_16',
'main' => 'grid_9 suffix_1', 'main' => 'grid_9 suffix_1',
'sidebar' => 'grid_6' 'sidebar' => 'grid_6'
) )
), ),
'960gs_24' => array( '960gs_24' => array(
'name' => '960gs_24', 'name' => '960gs_24',
'label' => __('960gs (24 cols)', 'roots'), 'label' => __('960gs (24 cols)', 'roots'),
'classes' => array( 'classes' => array(
'container' => 'container_24', 'container' => 'container_24',
'main' => 'grid_15 suffix_1', 'main' => 'grid_15 suffix_1',
'sidebar' => 'grid_8' 'sidebar' => 'grid_8'
) )
), ),
'1140' => array( '1140' => array(
'name' => '1140', 'name' => '1140',
'label' => __('1140', 'roots'), 'label' => __('1140', 'roots'),
'classes' => array( 'classes' => array(
'container' => 'twelvecol', 'container' => 'twelvecol',
'main' => 'eightcol', 'main' => 'eightcol',
'sidebar' => 'fourcol last' 'sidebar' => 'fourcol last'
) )
), ),
'adapt' => array( 'adapt' => array(
'name' => 'adapt', 'name' => 'adapt',
'label' => __('Adapt.js', 'roots'), 'label' => __('Adapt.js', 'roots'),
'classes' => array( 'classes' => array(
'container' => 'container_12 clearfix', 'container' => 'container_12 clearfix',
'main' => 'grid_7 suffix_1', 'main' => 'grid_7 suffix_1',
'sidebar' => 'grid_4' 'sidebar' => 'grid_4'
) )
), ),
'less' => array( 'less' => array(
'name' => 'less', 'name' => 'less',
'label' => __('Less Framework 4', 'roots'), 'label' => __('Less Framework 4', 'roots'),
'classes' => array( 'classes' => array(
'container' => 'container', 'container' => 'container',
'main' => '', 'main' => '',
'sidebar' => '' 'sidebar' => ''
) )
), ),
'none' => array( 'none' => array(
'name' => 'none', 'name' => 'none',
'label' => __('None', 'roots'), 'label' => __('None', 'roots'),
'classes' => array( 'classes' => array(
'container' => '', 'container' => '',
'main' => '', 'main' => '',
'sidebar' => '' 'sidebar' => ''
) )
) )
); );
// Write the above array of CSS frameworks into a script tag // Write the above array of CSS frameworks into a script tag
function roots_add_frameworks_object_script() { function roots_add_frameworks_object_script() {
global $roots_css_frameworks; global $roots_css_frameworks;
$json = json_encode($roots_css_frameworks); $json = json_encode($roots_css_frameworks);
?> ?>
<script> <script>
var roots_css_frameworks = <?php echo $json; ?>; var roots_css_frameworks = <?php echo $json; ?>;
</script> </script>
<?php <?php
} }
add_action('admin_head', 'roots_add_frameworks_object_script'); add_action('admin_head', 'roots_add_frameworks_object_script');
function roots_get_default_theme_options($default_framework = '') { function roots_get_default_theme_options($default_framework = '') {
global $roots_css_frameworks; global $roots_css_frameworks;
if ($default_framework == '') { $default_framework = apply_filters('roots_default_css_framework', 'blueprint'); } if ($default_framework == '') { $default_framework = apply_filters('roots_default_css_framework', 'blueprint'); }
$default_framework_settings = $roots_css_frameworks[$default_framework]; $default_framework_settings = $roots_css_frameworks[$default_framework];
$default_theme_options = array( $default_theme_options = array(
'css_framework' => $default_framework, 'css_framework' => $default_framework,
'container_class' => $default_framework_settings['classes']['container'], 'container_class' => $default_framework_settings['classes']['container'],
'main_class' => $default_framework_settings['classes']['main'], 'main_class' => $default_framework_settings['classes']['main'],
'sidebar_class' => $default_framework_settings['classes']['sidebar'], 'sidebar_class' => $default_framework_settings['classes']['sidebar'],
'google_analytics_id' => '', 'google_analytics_id' => '',
'root_relative_urls' => true, 'root_relative_urls' => true,
'clean_menu' => true, 'clean_menu' => true,
'fout_b_gone' => false 'fout_b_gone' => false
); );
return apply_filters('roots_default_theme_options', $default_theme_options); return apply_filters('roots_default_theme_options', $default_theme_options);
} }
function roots_get_theme_options() { function roots_get_theme_options() {
return get_option('roots_theme_options', roots_get_default_theme_options()); return get_option('roots_theme_options', roots_get_default_theme_options());
} }
function roots_theme_options_render_page() { function roots_theme_options_render_page() {
global $roots_css_frameworks; global $roots_css_frameworks;
?> ?>
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php printf(__('%s Theme Options', 'roots'), get_current_theme()); ?></h2> <h2><?php printf(__('%s Theme Options', 'roots'), get_current_theme()); ?></h2>
<?php settings_errors(); ?> <?php settings_errors(); ?>
<form method="post" action="options.php"> <form method="post" action="options.php">
<?php <?php
settings_fields('roots_options'); settings_fields('roots_options');
$roots_options = roots_get_theme_options(); $roots_options = roots_get_theme_options();
$roots_default_options = roots_get_default_theme_options($roots_options['css_framework']); $roots_default_options = roots_get_default_theme_options($roots_options['css_framework']);
?> ?>
<table class="form-table"> <table class="form-table">
<tr valign="top" class="radio-option"><th scope="row"><?php _e('CSS Grid Framework', 'roots'); ?></th> <tr valign="top" class="radio-option"><th scope="row"><?php _e('CSS Grid Framework', 'roots'); ?></th>
<td> <td>
<fieldset class="roots_css_frameworks"><legend class="screen-reader-text"><span><?php _e('CSS Grid Framework', 'roots'); ?></span></legend> <fieldset class="roots_css_frameworks"><legend class="screen-reader-text"><span><?php _e('CSS Grid Framework', 'roots'); ?></span></legend>
<select name="roots_theme_options[css_framework]" id="roots_theme_options[css_framework]"> <select name="roots_theme_options[css_framework]" id="roots_theme_options[css_framework]">
<?php foreach ($roots_css_frameworks as $css_framework) { ?> <?php foreach ($roots_css_frameworks as $css_framework) { ?>
<option value="<?php echo esc_attr($css_framework['name']); ?>" <?php selected($roots_options['css_framework'], $css_framework['name']); ?>><?php echo $css_framework['label']; ?></option> <option value="<?php echo esc_attr($css_framework['name']); ?>" <?php selected($roots_options['css_framework'], $css_framework['name']); ?>><?php echo $css_framework['label']; ?></option>
<?php } ?> <?php } ?>
</select> </select>
</fieldset> </fieldset>
</td> </td>
</tr> </tr>
<tr valign="top"><th scope="row"><?php _e('#main CSS Classes', 'roots'); ?></th> <tr valign="top"><th scope="row"><?php _e('#main CSS Classes', 'roots'); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e('#main CSS Classes', 'roots'); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e('#main CSS Classes', 'roots'); ?></span></legend>
<input type="text" name="roots_theme_options[main_class]" id="main_class" value="<?php echo esc_attr($roots_options['main_class']); ?>" class="regular-text" /> <input type="text" name="roots_theme_options[main_class]" id="main_class" value="<?php echo esc_attr($roots_options['main_class']); ?>" class="regular-text" />
<br /> <br />
<small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['main_class']; ?></span></small> <small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['main_class']; ?></span></small>
</fieldset> </fieldset>
</td> </td>
</tr> </tr>
<tr valign="top"><th scope="row"><?php _e('#sidebar CSS Classes', 'roots'); ?></th> <tr valign="top"><th scope="row"><?php _e('#sidebar CSS Classes', 'roots'); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e('#sidebar CSS Classes', 'roots'); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e('#sidebar CSS Classes', 'roots'); ?></span></legend>
<input type="text" name="roots_theme_options[sidebar_class]" id="sidebar_class" value="<?php echo esc_attr($roots_options['sidebar_class']); ?>" class="regular-text" /> <input type="text" name="roots_theme_options[sidebar_class]" id="sidebar_class" value="<?php echo esc_attr($roots_options['sidebar_class']); ?>" class="regular-text" />
<br /> <br />
<small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['sidebar_class']; ?></span></small> <small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['sidebar_class']; ?></span></small>
</fieldset> </fieldset>
</td> </td>
</tr> </tr>
<tr valign="top"><th scope="row"><?php _e('Google Analytics ID', 'roots'); ?></th> <tr valign="top"><th scope="row"><?php _e('Google Analytics ID', 'roots'); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Google Analytics ID', 'roots'); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e('Google Analytics ID', 'roots'); ?></span></legend>
<input type="text" name="roots_theme_options[google_analytics_id]" id="google_analytics_id" value="<?php echo esc_attr($roots_options['google_analytics_id']); ?>" /> <input type="text" name="roots_theme_options[google_analytics_id]" id="google_analytics_id" value="<?php echo esc_attr($roots_options['google_analytics_id']); ?>" />
<br /> <br />
<small class="description"><?php printf(__('Enter your UA-XXXXX-X ID', 'roots')); ?></small> <small class="description"><?php printf(__('Enter your UA-XXXXX-X ID', 'roots')); ?></small>
</fieldset> </fieldset>
</td> </td>
</tr> </tr>
<tr valign="top"><th scope="row"><?php _e('Enable Root Relative URLs', 'roots'); ?></th> <tr valign="top"><th scope="row"><?php _e('Enable Root Relative URLs', 'roots'); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Enable Root Relative URLs', 'roots'); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e('Enable Root Relative URLs', 'roots'); ?></span></legend>
<select name="roots_theme_options[root_relative_urls]" id="roots_theme_options[root_relative_urls]"> <select name="roots_theme_options[root_relative_urls]" id="roots_theme_options[root_relative_urls]">
<option value="yes" <?php selected($roots_options['root_relative_urls'], true); ?>><?php echo _e('Yes', 'roots'); ?></option> <option value="yes" <?php selected($roots_options['root_relative_urls'], true); ?>><?php echo _e('Yes', 'roots'); ?></option>
<option value="no" <?php selected($roots_options['root_relative_urls'], false); ?>><?php echo _e('No', 'roots'); ?></option> <option value="no" <?php selected($roots_options['root_relative_urls'], false); ?>><?php echo _e('No', 'roots'); ?></option>
</select> </select>
</fieldset> </fieldset>
</td> </td>
</tr> </tr>
<tr valign="top"><th scope="row"><?php _e('Cleanup Menu Output', 'roots'); ?></th> <tr valign="top"><th scope="row"><?php _e('Cleanup Menu Output', 'roots'); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Cleanup Menu Output', 'roots'); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e('Cleanup Menu Output', 'roots'); ?></span></legend>
<select name="roots_theme_options[clean_menu]" id="roots_theme_options[clean_menu]"> <select name="roots_theme_options[clean_menu]" id="roots_theme_options[clean_menu]">
<option value="yes" <?php selected($roots_options['clean_menu'], true); ?>><?php echo _e('Yes', 'roots'); ?></option> <option value="yes" <?php selected($roots_options['clean_menu'], true); ?>><?php echo _e('Yes', 'roots'); ?></option>
<option value="no" <?php selected($roots_options['clean_menu'], false); ?>><?php echo _e('No', 'roots'); ?></option> <option value="no" <?php selected($roots_options['clean_menu'], false); ?>><?php echo _e('No', 'roots'); ?></option>
</select> </select>
</fieldset> </fieldset>
</td> </td>
</tr> </tr>
<tr valign="top"><th scope="row"><?php _e('Enable FOUT-B-Gone', 'roots'); ?></th> <tr valign="top"><th scope="row"><?php _e('Enable FOUT-B-Gone', 'roots'); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Enable FOUT-B-Gone', 'roots'); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e('Enable FOUT-B-Gone', 'roots'); ?></span></legend>
<select name="roots_theme_options[fout_b_gone]" id="roots_theme_options[fout_b_gone]"> <select name="roots_theme_options[fout_b_gone]" id="roots_theme_options[fout_b_gone]">
<option value="yes" <?php selected($roots_options['fout_b_gone'], true); ?>><?php echo _e('Yes', 'roots'); ?></option> <option value="yes" <?php selected($roots_options['fout_b_gone'], true); ?>><?php echo _e('Yes', 'roots'); ?></option>
<option value="no" <?php selected($roots_options['fout_b_gone'], false); ?>><?php echo _e('No', 'roots'); ?></option> <option value="no" <?php selected($roots_options['fout_b_gone'], false); ?>><?php echo _e('No', 'roots'); ?></option>
</select> </select>
</fieldset> </fieldset>
</td> </td>
</tr> </tr>
</table> </table>
<?php submit_button(); ?> <?php submit_button(); ?>
</form> </form>
</div> </div>
<?php <?php
} }
function roots_theme_options_validate($input) { function roots_theme_options_validate($input) {
global $roots_css_frameworks; global $roots_css_frameworks;
$output = $defaults = roots_get_default_theme_options(); $output = $defaults = roots_get_default_theme_options();
if (isset($input['css_framework']) && array_key_exists($input['css_framework'], $roots_css_frameworks)) if (isset($input['css_framework']) && array_key_exists($input['css_framework'], $roots_css_frameworks))
$output['css_framework'] = $input['css_framework']; $output['css_framework'] = $input['css_framework'];
// set the value of the main container class depending on the selected grid framework // set the value of the main container class depending on the selected grid framework
$output['container_class'] = $roots_css_frameworks[$output['css_framework']]['classes']['container']; $output['container_class'] = $roots_css_frameworks[$output['css_framework']]['classes']['container'];
if (isset($input['main_class'])) { if (isset($input['main_class'])) {
$output['main_class'] = wp_filter_nohtml_kses($input['main_class']); $output['main_class'] = wp_filter_nohtml_kses($input['main_class']);
} }
if (isset($input['sidebar_class'])) { if (isset($input['sidebar_class'])) {
$output['sidebar_class'] = wp_filter_nohtml_kses($input['sidebar_class']); $output['sidebar_class'] = wp_filter_nohtml_kses($input['sidebar_class']);
} }
if (isset($input['google_analytics_id'])) { if (isset($input['google_analytics_id'])) {
if (preg_match('/^ua-\d{4,9}-\d{1,4}$/i', $input['google_analytics_id'])) { if (preg_match('/^ua-\d{4,9}-\d{1,4}$/i', $input['google_analytics_id'])) {
$output['google_analytics_id'] = $input['google_analytics_id']; $output['google_analytics_id'] = $input['google_analytics_id'];
} }
} }
if (isset($input['root_relative_urls'])) { if (isset($input['root_relative_urls'])) {
if ($input['root_relative_urls'] === 'yes') { if ($input['root_relative_urls'] === 'yes') {
$input['root_relative_urls'] = true; $input['root_relative_urls'] = true;
} }
if ($input['root_relative_urls'] === 'no') { if ($input['root_relative_urls'] === 'no') {
$input['root_relative_urls'] = false; $input['root_relative_urls'] = false;
} }
$output['root_relative_urls'] = $input['root_relative_urls']; $output['root_relative_urls'] = $input['root_relative_urls'];
} }
if (isset($input['clean_menu'])) { if (isset($input['clean_menu'])) {
if ($input['clean_menu'] === 'yes') { if ($input['clean_menu'] === 'yes') {
$input['clean_menu'] = true; $input['clean_menu'] = true;
} }
if ($input['clean_menu'] === 'no') { if ($input['clean_menu'] === 'no') {
$input['clean_menu'] = false; $input['clean_menu'] = false;
} }
$output['clean_menu'] = $input['clean_menu']; $output['clean_menu'] = $input['clean_menu'];
} }
if (isset($input['fout_b_gone'])) { if (isset($input['fout_b_gone'])) {
if ($input['fout_b_gone'] === 'yes') { if ($input['fout_b_gone'] === 'yes') {
$input['fout_b_gone'] = true; $input['fout_b_gone'] = true;
} }
if ($input['fout_b_gone'] === 'no') { if ($input['fout_b_gone'] === 'no') {
$input['fout_b_gone'] = false; $input['fout_b_gone'] = false;
} }
$output['fout_b_gone'] = $input['fout_b_gone']; $output['fout_b_gone'] = $input['fout_b_gone'];
} }
return apply_filters('roots_theme_options_validate', $output, $input, $defaults); return apply_filters('roots_theme_options_validate', $output, $input, $defaults);
} }
?> ?>

View File

@@ -2,72 +2,72 @@
class roots_vcard extends WP_Widget { class roots_vcard extends WP_Widget {
function roots_vcard() { function roots_vcard() {
$widget_ops = array('description' => 'Display a vCard'); $widget_ops = array('description' => 'Display a vCard');
parent::WP_Widget(false, __('Roots: vCard', 'roots'), $widget_ops); parent::WP_Widget(false, __('Roots: vCard', 'roots'), $widget_ops);
} }
function widget($args, $instance) { function widget($args, $instance) {
extract($args); extract($args);
extract($instance); extract($instance);
echo $before_widget; echo $before_widget;
if ($title) { if ($title) {
echo $before_title, $title, $after_title; echo $before_title, $title, $after_title;
} }
?> ?>
<p class="vcard"> <p class="vcard">
<a class="fn org url" href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a><br> <a class="fn org url" href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a><br>
<span class="adr"> <span class="adr">
<span class="street-address"><?php echo $street_address; ?></span><br> <span class="street-address"><?php echo $street_address; ?></span><br>
<span class="locality"><?php echo $locality; ?></span>, <span class="locality"><?php echo $locality; ?></span>,
<span class="region"><?php echo $region; ?></span> <span class="region"><?php echo $region; ?></span>
<span class="postal-code"><?php echo $postal_code; ?></span><br> <span class="postal-code"><?php echo $postal_code; ?></span><br>
</span> </span>
<span class="tel"><span class="value"><span class="hidden">+1-</span><?php echo $tel; ?></span></span><br> <span class="tel"><span class="value"><span class="hidden">+1-</span><?php echo $tel; ?></span></span><br>
<a class="email" href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a> <a class="email" href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a>
</p> </p>
<?php <?php
echo $after_widget; echo $after_widget;
} }
function update($new_instance, $old_instance) { function update($new_instance, $old_instance) {
return $new_instance; return $new_instance;
} }
function form($instance) { function form($instance) {
?> ?>
<p> <p>
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title (optional):', 'roots'); ?></label> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title (optional):', 'roots'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset($instance['title'])) { echo esc_attr($instance['title']); } ?>" class="widefat" id="<?php if (isset($instance['title'])) { echo $this->get_field_id('title'); } ?>" /> <input type="text" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset($instance['title'])) { echo esc_attr($instance['title']); } ?>" class="widefat" id="<?php if (isset($instance['title'])) { echo $this->get_field_id('title'); } ?>" />
</p> </p>
<p> <p>
<label for="<?php echo $this->get_field_id('street_address'); ?>"><?php _e('Street Address:', 'roots'); ?></label> <label for="<?php echo $this->get_field_id('street_address'); ?>"><?php _e('Street Address:', 'roots'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('street_address'); ?>" value="<?php if (isset($instance['street_address'])) { echo esc_attr($instance['street_address']); } ?>" class="widefat" id="<?php if (isset($instance['street_address'])) { echo $this->get_field_id('street_address'); } ?>" /> <input type="text" name="<?php echo $this->get_field_name('street_address'); ?>" value="<?php if (isset($instance['street_address'])) { echo esc_attr($instance['street_address']); } ?>" class="widefat" id="<?php if (isset($instance['street_address'])) { echo $this->get_field_id('street_address'); } ?>" />
</p> </p>
<p> <p>
<label for="<?php echo $this->get_field_id('locality'); ?>"><?php _e('City/Locality:', 'roots'); ?></label> <label for="<?php echo $this->get_field_id('locality'); ?>"><?php _e('City/Locality:', 'roots'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('locality'); ?>" value="<?php if (isset($instance['locality'])) { echo esc_attr($instance['locality']); } ?>" class="widefat" id="<?php if (isset($instance['locality'])) { echo $this->get_field_id('locality'); } ?>" /> <input type="text" name="<?php echo $this->get_field_name('locality'); ?>" value="<?php if (isset($instance['locality'])) { echo esc_attr($instance['locality']); } ?>" class="widefat" id="<?php if (isset($instance['locality'])) { echo $this->get_field_id('locality'); } ?>" />
</p> </p>
<p> <p>
<label for="<?php echo $this->get_field_id('region'); ?>"><?php _e('State/Region:', 'roots'); ?></label> <label for="<?php echo $this->get_field_id('region'); ?>"><?php _e('State/Region:', 'roots'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('region'); ?>" value="<?php if (isset($instance['region'])) { echo esc_attr($instance['region']); } ?>" class="widefat" id="<?php if (isset($instance['region'])) { echo $this->get_field_id('region'); } ?>" /> <input type="text" name="<?php echo $this->get_field_name('region'); ?>" value="<?php if (isset($instance['region'])) { echo esc_attr($instance['region']); } ?>" class="widefat" id="<?php if (isset($instance['region'])) { echo $this->get_field_id('region'); } ?>" />
</p> </p>
<p> <p>
<label for="<?php echo $this->get_field_id('postal_code'); ?>"><?php _e('Zipcode/Postal Code:', 'roots'); ?></label> <label for="<?php echo $this->get_field_id('postal_code'); ?>"><?php _e('Zipcode/Postal Code:', 'roots'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('postal_code'); ?>" value="<?php if (isset($instance['postal_code'])) { echo esc_attr($instance['postal_code']); } ?>" class="widefat" id="<?php if (isset($instance['postal_code'])) { echo $this->get_field_id('postal_code'); } ?>" /> <input type="text" name="<?php echo $this->get_field_name('postal_code'); ?>" value="<?php if (isset($instance['postal_code'])) { echo esc_attr($instance['postal_code']); } ?>" class="widefat" id="<?php if (isset($instance['postal_code'])) { echo $this->get_field_id('postal_code'); } ?>" />
</p> </p>
<p> <p>
<label for="<?php echo $this->get_field_id('tel'); ?>"><?php _e('Telephone:', 'roots'); ?></label> <label for="<?php echo $this->get_field_id('tel'); ?>"><?php _e('Telephone:', 'roots'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('tel'); ?>" value="<?php if (isset($instance['tel'])) { echo esc_attr($instance['tel']); } ?>" class="widefat" id="<?php if (isset($instance['tel'])) { echo $this->get_field_id('tel'); } ?>" /> <input type="text" name="<?php echo $this->get_field_name('tel'); ?>" value="<?php if (isset($instance['tel'])) { echo esc_attr($instance['tel']); } ?>" class="widefat" id="<?php if (isset($instance['tel'])) { echo $this->get_field_id('tel'); } ?>" />
</p> </p>
<p> <p>
<label for="<?php echo $this->get_field_id('email'); ?>"><?php _e('Email:', 'roots'); ?></label> <label for="<?php echo $this->get_field_id('email'); ?>"><?php _e('Email:', 'roots'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('email'); ?>" value="<?php if (isset($instance['email'])) { echo esc_attr($instance['email']); } ?>" class="widefat" id="<?php if (isset($instance['email'])) { echo $this->get_field_id('email'); } ?>" /> <input type="text" name="<?php echo $this->get_field_name('email'); ?>" value="<?php if (isset($instance['email'])) { echo esc_attr($instance['email']); } ?>" class="widefat" id="<?php if (isset($instance['email'])) { echo $this->get_field_id('email'); } ?>" />
</p> </p>
<?php <?php
} }
} }
register_widget('roots_vcard'); register_widget('roots_vcard');
?> ?>

View File

@@ -1,23 +1,23 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container"> <div class="container">
<h1><?php _e('Latest Posts', 'roots');?></h1> <h1><?php _e('Latest Posts', 'roots');?></h1>
<?php get_template_part('loop', 'index'); ?> <?php get_template_part('loop', 'index'); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?> <?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary"> <aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?> <?php roots_sidebar_inside_before(); ?>
<div class="container"> <div class="container">
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> </div>
<?php roots_sidebar_inside_after(); ?> <?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?> <?php roots_sidebar_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -1,8 +1,3 @@
/* Author: /* Author:
*/ */

View File

@@ -1,10 +1,10 @@
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?> <?php roots_post_before(); ?>
<?php roots_post_inside_before(); ?> <?php roots_post_inside_before(); ?>
<h1><?php the_title(); ?></h1> <h1><?php the_title(); ?></h1>
<?php the_content(); ?> <?php the_content(); ?>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?> <?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
<?php roots_post_inside_after(); ?> <?php roots_post_inside_after(); ?>
<?php roots_post_after(); ?> <?php roots_post_after(); ?>
<?php endwhile; // End the loop ?> <?php endwhile; // End the loop ?>

View File

@@ -1,35 +1,35 @@
<?php /* If there are no posts to display, such as an empty archive page */ ?> <?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if (!have_posts()) : ?> <?php if (!have_posts()) : ?>
<div class="notice"> <div class="notice">
<p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p> <p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div> </div>
<?php get_search_form(); ?> <?php get_search_form(); ?>
<?php endif; ?> <?php endif; ?>
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?> <?php roots_post_before(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php roots_post_inside_before(); ?> <?php roots_post_inside_before(); ?>
<header> <header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php roots_entry_meta(); ?> <?php roots_entry_meta(); ?>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
</div> </div>
<footer> <footer>
<?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?> <?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?>
</footer> </footer>
<?php roots_post_inside_after(); ?> <?php roots_post_inside_after(); ?>
</article> </article>
<?php roots_post_after(); ?> <?php roots_post_after(); ?>
<?php endwhile; // End the loop ?> <?php endwhile; // End the loop ?>
<?php /* Display navigation to next/previous pages when applicable */ ?> <?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ($wp_query->max_num_pages > 1) : ?> <?php if ($wp_query->max_num_pages > 1) : ?>
<nav id="post-nav"> <nav id="post-nav">
<div class="post-previous"><?php next_posts_link( __( '&larr; Older posts', 'roots' ) ); ?></div> <div class="post-previous"><?php next_posts_link( __( '&larr; Older posts', 'roots' ) ); ?></div>
<div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'roots' ) ); ?></div> <div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'roots' ) ); ?></div>
</nav> </nav>
<?php endif; ?> <?php endif; ?>

View File

@@ -1,21 +1,21 @@
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?> <?php roots_post_before(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>"> <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<?php roots_post_inside_before(); ?> <?php roots_post_inside_before(); ?>
<header> <header>
<h1 class="entry-title"><?php the_title(); ?></h1> <h1 class="entry-title"><?php the_title(); ?></h1>
<?php roots_entry_meta(); ?> <?php roots_entry_meta(); ?>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<?php the_content(); ?> <?php the_content(); ?>
</div> </div>
<footer> <footer>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?> <?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
<p><?php the_tags(); ?></p> <p><?php the_tags(); ?></p>
</footer> </footer>
<?php comments_template(); ?> <?php comments_template(); ?>
<?php roots_post_inside_after(); ?> <?php roots_post_inside_after(); ?>
</article> </article>
<?php roots_post_after(); ?> <?php roots_post_after(); ?>
<?php endwhile; // End the loop ?> <?php endwhile; // End the loop ?>

View File

@@ -1,39 +1,39 @@
<?php /* If there are no posts to display, such as an empty archive page */ ?> <?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if (!have_posts()) : ?> <?php if (!have_posts()) : ?>
<div class="notice"> <div class="notice">
<p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p> <p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div> </div>
<?php get_search_form(); ?> <?php get_search_form(); ?>
<?php endif; ?> <?php endif; ?>
<?php /* Start loop */ ?> <?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?> <?php roots_post_before(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php roots_post_inside_before(); ?> <?php roots_post_inside_before(); ?>
<header> <header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php roots_entry_meta(); ?> <?php roots_entry_meta(); ?>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?> <?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?>
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
<?php else : ?> <?php else : ?>
<?php the_content(); ?> <?php the_content(); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<footer> <footer>
<?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?> <?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?>
</footer> </footer>
<?php roots_post_inside_after(); ?> <?php roots_post_inside_after(); ?>
</article> </article>
<?php roots_post_after(); ?> <?php roots_post_after(); ?>
<?php endwhile; // End the loop ?> <?php endwhile; // End the loop ?>
<?php /* Display navigation to next/previous pages when applicable */ ?> <?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ($wp_query->max_num_pages > 1) : ?> <?php if ($wp_query->max_num_pages > 1) : ?>
<nav id="post-nav"> <nav id="post-nav">
<div class="post-previous"><?php next_posts_link( __( '&larr; Older posts', 'roots' ) ); ?></div> <div class="post-previous"><?php next_posts_link( __( '&larr; Older posts', 'roots' ) ); ?></div>
<div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'roots' ) ); ?></div> <div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'roots' ) ); ?></div>
</nav> </nav>
<?php endif; ?> <?php endif; ?>

View File

@@ -3,26 +3,26 @@
Template Name: Custom Template Name: Custom
*/ */
get_header(); ?> get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container"> <div class="container">
<?php roots_loop_before(); ?> <?php roots_loop_before(); ?>
<?php get_template_part('loop', 'page'); ?> <?php get_template_part('loop', 'page'); ?>
<?php roots_loop_after(); ?> <?php roots_loop_after(); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?> <?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary"> <aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?> <?php roots_sidebar_inside_before(); ?>
<div class="container"> <div class="container">
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> </div>
<?php roots_sidebar_inside_after(); ?> <?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?> <?php roots_sidebar_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -3,17 +3,17 @@
Template Name: Full Width Template Name: Full Width
*/ */
get_header(); ?> get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['container_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['container_class']; ?>" role="main">
<div class="container"> <div class="container">
<?php roots_loop_before(); ?> <?php roots_loop_before(); ?>
<?php get_template_part('loop', 'page'); ?> <?php get_template_part('loop', 'page'); ?>
<?php roots_loop_after(); ?> <?php roots_loop_after(); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -1,24 +1,24 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container"> <div class="container">
<?php roots_loop_before(); ?> <?php roots_loop_before(); ?>
<?php get_template_part('loop', 'page'); ?> <?php get_template_part('loop', 'page'); ?>
<?php roots_loop_after(); ?> <?php roots_loop_after(); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?> <?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary"> <aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?> <?php roots_sidebar_inside_before(); ?>
<div class="container"> <div class="container">
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> </div>
<?php roots_sidebar_inside_after(); ?> <?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?> <?php roots_sidebar_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -1,25 +1,25 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container"> <div class="container">
<h1><?php _e('Search Results for', 'roots'); ?> <?php echo get_search_query(); ?></h1> <h1><?php _e('Search Results for', 'roots'); ?> <?php echo get_search_query(); ?></h1>
<?php roots_loop_before(); ?> <?php roots_loop_before(); ?>
<?php get_template_part('loop', 'search'); ?> <?php get_template_part('loop', 'search'); ?>
<?php roots_loop_after(); ?> <?php roots_loop_after(); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?> <?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary"> <aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?> <?php roots_sidebar_inside_before(); ?>
<div class="container"> <div class="container">
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> </div>
<?php roots_sidebar_inside_after(); ?> <?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?> <?php roots_sidebar_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -1,5 +1,5 @@
<form role="search" method="get" id="searchform" action="<?php echo home_url('/'); ?>"> <form role="search" method="get" id="searchform" action="<?php echo home_url('/'); ?>">
<label class="visuallyhidden" for="s"><?php _e('Search for:', 'roots'); ?></label> <label class="visuallyhidden" for="s"><?php _e('Search for:', 'roots'); ?></label>
<input type="text" value="" name="s" id="s" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>"> <input type="text" value="" name="s" id="s" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>">
<input type="submit" id="searchsubmit" value="<?php _e('Search', 'roots'); ?>" class="button"> <input type="submit" id="searchsubmit" value="<?php _e('Search', 'roots'); ?>" class="button">
</form> </form>

View File

@@ -1,24 +1,24 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php roots_content_before(); ?> <?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>"> <div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?> <?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main"> <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container"> <div class="container">
<?php roots_loop_before(); ?> <?php roots_loop_before(); ?>
<?php get_template_part('loop', 'single'); ?> <?php get_template_part('loop', 'single'); ?>
<?php roots_loop_after(); ?> <?php roots_loop_after(); ?>
</div> </div>
</div><!-- /#main --> </div><!-- /#main -->
<?php roots_main_after(); ?> <?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?> <?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary"> <aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?> <?php roots_sidebar_inside_before(); ?>
<div class="container"> <div class="container">
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> </div>
<?php roots_sidebar_inside_after(); ?> <?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar --> </aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?> <?php roots_sidebar_after(); ?>
</div><!-- /#content --> </div><!-- /#content -->
<?php roots_content_after(); ?> <?php roots_content_after(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>