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 roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?>
<div id="main" role="main">
<div class="container">
<h1><?php _e('File Not Found', 'roots'); ?></h1>
<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>
</div>
<p><?php _e('Please try the following:', 'roots'); ?></p>
<ul>
<li><?php _e('Check your spelling', 'roots'); ?> </li>
<li><?php printf(__('Return to the <a href="%s">home page</a>', 'roots'), home_url()); ?></li>
<li><?php _e('Click the <a href="javascript:history.back()">Back</a> button', 'roots'); ?></li>
</ul>
</div>
</div><!-- /#main -->
<?php roots_main_after(); ?>
</div><!-- /#content -->
<?php roots_content_after(); ?>
<?php get_footer(); ?>
<?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?>
<div id="main" role="main">
<div class="container">
<h1><?php _e('File Not Found', 'roots'); ?></h1>
<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>
</div>
<p><?php _e('Please try the following:', 'roots'); ?></p>
<ul>
<li><?php _e('Check your spelling', 'roots'); ?> </li>
<li><?php printf(__('Return to the <a href="%s">home page</a>', 'roots'), home_url()); ?></li>
<li><?php _e('Click the <a href="javascript:history.back()">Back</a> button', 'roots'); ?></li>
</ul>
</div>
</div><!-- /#main -->
<?php roots_main_after(); ?>
</div><!-- /#content -->
<?php roots_content_after(); ?>
<?php get_footer(); ?>

174
README.md
View File

@@ -4,172 +4,172 @@
### 3.6.0: August 12th, 2011
<ul>
<li>HTML5 Boilerplate 2.0 updates</li>
<li>Cleaner output of enqueued styles and scripts</li>
<li>Added option for root relative URLs</li>
<li>Small fixes to root relative URLs and clean assets</li>
<li>Updated included jQuery plugins</li>
<li>Added French translation (thanks @johnraz)</li>
<li>Added Brazilian Portuguese translation (thanks @weslly)</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>Code cleanup and re-organization</li>
<li>HTML5 Boilerplate 2.0 updates</li>
<li>Cleaner output of enqueued styles and scripts</li>
<li>Added option for root relative URLs</li>
<li>Small fixes to root relative URLs and clean assets</li>
<li>Updated included jQuery plugins</li>
<li>Added French translation (thanks @johnraz)</li>
<li>Added Brazilian Portuguese translation (thanks @weslly)</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>Code cleanup and re-organization</li>
</ul>
### 3.5.0: July 30th, 2011
<ul>
<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: added support for Adapt.js and LESS</li>
<li>CSS frameworks: added option for None</li>
<li>Added support for WPML and theme translation</li>
<li>Added option for cleaner nav menu output</li>
<li>Added option for FOUT-B-Gone</li>
<li>Added authorship rel attribute to post author link</li>
<li>Activation bugfix for pages being added multiple times</li>
<li>Bugfixes to the root relative URL function</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>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>Renamed <code>includes/</code> directory to <code>inc/</code></li>
<li>Added a blank <code>inc/roots-custom.php</code> file</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: added support for Adapt.js and LESS</li>
<li>CSS frameworks: added option for None</li>
<li>Added support for WPML and theme translation</li>
<li>Added option for cleaner nav menu output</li>
<li>Added option for FOUT-B-Gone</li>
<li>Added authorship rel attribute to post author link</li>
<li>Activation bugfix for pages being added multiple times</li>
<li>Bugfixes to the root relative URL function</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>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>Renamed <code>includes/</code> directory to <code>inc/</code></li>
<li>Added a blank <code>inc/roots-custom.php</code> file</li>
</ul>
### 3.2.4: May 19th, 2011
<ul>
<li>Bugfixes</li>
<li>Matching latest changes to HTML5 Boilerplate and Blueprint CSS</li>
<li>Updated jQuery to 1.6.1</li>
<li>Bugfixes</li>
<li>Matching latest changes to HTML5 Boilerplate and Blueprint CSS</li>
<li>Updated jQuery to 1.6.1</li>
</ul>
### 3.2.3: May 10th, 2011
<ul>
<li>Bugfixes</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>Updated jQuery to 1.6</li>
<li>Bugfixes</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>Updated jQuery to 1.6</li>
</ul>
### 3.2.2: April 24th, 2011
<ul>
<li>Bugfixes</li>
<li>Bugfixes</li>
</ul>
### 3.2.1: April 20th, 2011
<ul>
<li>Added support for child themes</li>
<li>Added support for child themes</li>
</ul>
### 3.2.0: April 15th, 2011
<ul>
<li>Added support for the 1140px Grid</li>
<li>Updated the conditional comment code to match latest changes to HTML5 Boilerplate</li>
<li>Added support for the 1140px Grid</li>
<li>Updated the conditional comment code to match latest changes to HTML5 Boilerplate</li>
</ul>
### 3.1.1: April 7th, 2011
<ul>
<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>Fixed comments to show avatars correctly</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>Fixed comments to show avatars correctly</li>
</ul>
### 3.1.0: April 1st, 2011
<ul>
<li>Added support for 960.gs thanks to John Liuti</li>
<li>Added more onto the <code>.htaccess</code> from HTML5 Boilerplate</li>
<li>Made the theme directory and name renamable</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>Made the theme directory and name renamable</li>
</ul>
### 3.0.0: March 28th, 2011
<ul>
<li>Changed name from BB to Roots</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>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>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><code>/wp-content/plugins/</code> now rewrites to <code>/plugins/</code></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><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>Added more <code>loop.php</code> templates</li>
<li>Made the HTML editor have a monospaced font</li>
<li>Added <code>front-page.php</code></li>
<li>Updated CSS for Gravity Forms 1.5</li>
<li>Added <code>searchform.php template</code></li>
<li>Changed name from BB to Roots</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>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>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><code>/wp-content/plugins/</code> now rewrites to <code>/plugins/</code></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><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>Added more <code>loop.php</code> templates</li>
<li>Made the HTML editor have a monospaced font</li>
<li>Added <code>front-page.php</code></li>
<li>Updated CSS for Gravity Forms 1.5</li>
<li>Added <code>searchform.php template</code></li>
</ul>
### 2.4.0: January 25th, 2011
<ul>
<li>Added a notification when saving the theme settings</li>
<li>Added support for navigation menus</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>Added a notification when saving the theme settings</li>
<li>Added support for navigation menus</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>
</ul>
### 2.3.0: December 8th, 2010
<ul>
<li>Logo is no longer an <code>&lt;h1&gt;</code></li>
<li>Added ARIA roles again</li>
<li>Changed <code>ul#nav</code> to <code>nav#nav-main</code></li>
<li>Added vCard to footer</li>
<li>Made all URL's root relative</li>
<li>Added Twitter and Facebook widgets to footer</li>
<li>Added SEO optimized <code>robots.txt</code> from WordPress codex</li>
<li>Logo is no longer an <code>&lt;h1&gt;</code></li>
<li>Added ARIA roles again</li>
<li>Changed <code>ul#nav</code> to <code>nav#nav-main</code></li>
<li>Added vCard to footer</li>
<li>Made all URL's root relative</li>
<li>Added Twitter and Facebook widgets to footer</li>
<li>Added SEO optimized <code>robots.txt</code> from WordPress codex</li>
</ul>
### 2.2.0: September 20th, 2010
<ul>
<li>Added asynchronous Google Analytics</li>
<li>Updated <code>.htaccess</code> with latest changes from HTML5 Boilerplate</li>
<li>Added asynchronous Google Analytics</li>
<li>Updated <code>.htaccess</code> with latest changes from HTML5 Boilerplate</li>
</ul>
### 2.1.0: August 19th, 2010
<ul>
<li>Removed optimizeLegibility from headings</li>
<li>Updated jQuery to latest version</li>
<li>Implemented HTML5 Boilerplate <code>.htaccess</code></li>
<li>Removed optimizeLegibility from headings</li>
<li>Updated jQuery to latest version</li>
<li>Implemented HTML5 Boilerplate <code>.htaccess</code></li>
</ul>
### 2.0.1: August 2nd, 2010
<ul>
<li>Added some presentational CSS classes</li>
<li>Added footer widget</li>
<li>Added more Gravity Forms default styling</li>
<li>Added some presentational CSS classes</li>
<li>Added footer widget</li>
<li>Added more Gravity Forms default styling</li>
</ul>
### 2.0.0: July 19th, 2010
<ul>
<li>Added HTML5 Boilerplate changes</li>
<li>Implemented <code>loop.php</code></li>
<li>wp_head cleanup</li>
<li>Added <code>page-subpages.php</code> template</li>
<li>Added HTML5 Boilerplate changes</li>
<li>Implemented <code>loop.php</code></li>
<li>wp_head cleanup</li>
<li>Added <code>page-subpages.php</code> template</li>
</ul>
### 1.5.0: April 15th, 2010
<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>
### 1.0.0: December 18th, 2009
<ul>
<li>Added Blueprint CSS to Starkers</li>
<li>Added Blueprint CSS to Starkers</li>
</ul>
## Contributors:
@@ -189,8 +189,8 @@ Major components:
Everything else:
* [The Unlicense](http://unlicense.org) (aka: public domain)
* [The Unlicense](http://unlicense.org) (aka: public domain)
## 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 roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container">
<h1>
<?php if (is_day()) : ?>
<?php printf(__('Daily Archives: %s', 'roots'), get_the_date()); ?>
<?php elseif (is_month()) : ?>
<?php printf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y')); ?>
<?php elseif (is_year()) : ?>
<?php printf(__('Yearly Archives: %s', 'roots'), get_the_date('Y')); ?>
<?php else : ?>
<?php single_cat_title(); ?>
<?php endif; ?>
</h1>
<?php roots_loop_before(); ?>
<?php get_template_part('loop', 'category'); ?>
<?php roots_loop_after(); ?>
</div>
</div><!-- /#main -->
<?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?>
<div class="container">
<?php get_sidebar(); ?>
</div>
<?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?>
</div><!-- /#content -->
<?php roots_content_after(); ?>
<?php get_footer(); ?>
<?php roots_content_before(); ?>
<div id="content" class="<?php echo $roots_options['container_class']; ?>">
<?php roots_main_before(); ?>
<div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">
<div class="container">
<h1>
<?php if (is_day()) : ?>
<?php printf(__('Daily Archives: %s', 'roots'), get_the_date()); ?>
<?php elseif (is_month()) : ?>
<?php printf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y')); ?>
<?php elseif (is_year()) : ?>
<?php printf(__('Yearly Archives: %s', 'roots'), get_the_date('Y')); ?>
<?php else : ?>
<?php single_cat_title(); ?>
<?php endif; ?>
</h1>
<?php roots_loop_before(); ?>
<?php get_template_part('loop', 'category'); ?>
<?php roots_loop_after(); ?>
</div>
</div><!-- /#main -->
<?php roots_main_after(); ?>
<?php roots_sidebar_before(); ?>
<aside id="sidebar" class="<?php echo $roots_options['sidebar_class']; ?>" role="complementary">
<?php roots_sidebar_inside_before(); ?>
<div class="container">
<?php get_sidebar(); ?>
</div>
<?php roots_sidebar_inside_after(); ?>
</aside><!-- /#sidebar -->
<?php roots_sidebar_after(); ?>
</div><!-- /#content -->
<?php roots_content_after(); ?>
<?php get_footer(); ?>

View File

@@ -1,102 +1,102 @@
<?php function roots_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?>>
<article id="comment-<?php comment_ID(); ?>">
<header class="comment-author vcard">
<?php echo get_avatar($comment,$size='32'); ?>
<?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>
<?php edit_comment_link(__('(Edit)', 'roots'), '', '') ?>
</header>
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?>>
<article id="comment-<?php comment_ID(); ?>">
<header class="comment-author vcard">
<?php echo get_avatar($comment,$size='32'); ?>
<?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>
<?php edit_comment_link(__('(Edit)', 'roots'), '', '') ?>
</header>
<?php if ($comment->comment_approved == '0') : ?>
<div class="notice">
<p class="bottom"><?php _e('Your comment is awaiting moderation.', 'roots') ?></p>
</div>
<?php endif; ?>
<section class="comment">
<?php comment_text() ?>
</section>
<?php if ($comment->comment_approved == '0') : ?>
<div class="notice">
<p class="bottom"><?php _e('Your comment is awaiting moderation.', 'roots') ?></p>
</div>
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</article>
<?php endif; ?>
<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
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die (__('Please do not load this page directly. Thanks!', 'roots'));
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die (__('Please do not load this page directly. Thanks!', 'roots'));
if ( post_password_required() ) { ?>
<section id="comments">
<div class="notice">
<p class="bottom"><?php _e('This post is password protected. Enter the password to view comments.', 'roots'); ?></p>
</div>
</section>
<?php
return;
}
if ( post_password_required() ) { ?>
<section id="comments">
<div class="notice">
<p class="bottom"><?php _e('This post is password protected. Enter the password to view comments.', 'roots'); ?></p>
</div>
</section>
<?php
return;
}
?>
<?php // You can start editing here. ?>
<?php if ( have_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>
<ol class="commentlist">
<?php wp_list_comments('type=comment&callback=roots_comments'); ?>
<?php // wp_list_comments(); ?>
</ol>
<footer>
<nav id="comments-nav">
<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>
</nav>
</footer>
</section>
<section id="comments">
<h3><?php comments_number(__('No Responses to', 'roots'), __('One Response to', 'roots'), __('% Responses to', 'roots') ); ?> &#8220;<?php the_title(); ?>&#8221;</h3>
<ol class="commentlist">
<?php wp_list_comments('type=comment&callback=roots_comments'); ?>
<?php // wp_list_comments(); ?>
</ol>
<footer>
<nav id="comments-nav">
<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>
</nav>
</footer>
</section>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ( comments_open() ) : ?>
<?php else : // comments are closed ?>
<section id="comments">
<div class="notice">
<p class="bottom"><?php _e('Comments are closed.', 'roots') ?></p>
</div>
</section>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<?php else : // comments are closed ?>
<section id="comments">
<div class="notice">
<p class="bottom"><?php _e('Comments are closed.', 'roots') ?></p>
</div>
</section>
<?php endif; ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<section id="respond">
<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>
<?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>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?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>
<?php else : ?>
<p>
<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'"; ?>>
</p>
<p>
<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'"; ?>>
</p>
<p>
<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">
</p>
<?php endif; ?>
<p>
<label for="comment"><?php _e('Comment', 'roots'); ?></label>
<textarea name="comment" id="comment" tabindex="4"></textarea>
</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 do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
<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>
<?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>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?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>
<?php else : ?>
<p>
<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'"; ?>>
</p>
<p>
<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'"; ?>>
</p>
<p>
<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">
</p>
<?php endif; ?>
<p>
<label for="comment"><?php _e('Comment', 'roots'); ?></label>
<textarea name="comment" id="comment" tabindex="4"></textarea>
</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 do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
</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; }
.button, #post-nav a, #comments-nav a {
display: inline-block;
background: #06c;
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: -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));
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
color: #fff;
border: none;
padding: 8px 16px;
cursor: pointer;
text-decoration: none;
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15);
width: auto;
overflow: visible;
-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;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-appearance: none;
display: inline-block;
background: #06c;
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: -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));
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
color: #fff;
border: none;
padding: 8px 16px;
cursor: pointer;
text-decoration: none;
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15);
width: auto;
overflow: visible;
-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;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2), 1px 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-appearance: none;
}
.button:hover, #post-nav a:hover, #comments-nav a:hover {
background: #09f;
color: #fff;
.button:hover, #post-nav a:hover, #comments-nav a:hover {
background: #09f;
color: #fff;
}
@@ -168,68 +168,68 @@ td { vertical-align: top; }
#logo { float: left; width: 300px; height: 75px; margin: 0 0 16px; padding: 0; }
#nav-main ul {
background: #06c;
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: -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));
position: relative;
list-style: none;
margin: 0 0 16px 0;
padding: 0;
float: left;
width: 100%;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
#nav-main ul {
background: #06c;
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: -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));
position: relative;
list-style: none;
margin: 0 0 16px 0;
padding: 0;
float: left;
width: 100%;
-moz-border-radius: 6px;
-webkit-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 a {
text-decoration: none;
display: block;
font-size: 14px;
padding: 8px 16px;
color: #fff;
margin: 0;
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15);
#nav-main ul li a {
text-decoration: none;
display: block;
font-size: 14px;
padding: 8px 16px;
color: #fff;
margin: 0;
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.15);
}
#nav-main ul li a:hover,
#nav-main ul li.current-menu-item > a,
#nav-main ul li.current-menu-parent > a,
#nav-main ul li.current-menu-ancestor > a,
#nav-main ul li:hover > a {
color: #73c8ff;
#nav-main ul li a:hover,
#nav-main ul li.current-menu-item > a,
#nav-main ul li.current-menu-parent > a,
#nav-main ul li.current-menu-ancestor > a,
#nav-main ul li:hover > a {
color: #73c8ff;
}
#nav-main ul ul {
position: absolute;
visibility: hidden;
top: 100%;
left: 0;
width: 200px;
background: #73c8ff;
padding: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
#nav-main ul ul {
position: absolute;
visibility: hidden;
top: 100%;
left: 0;
width: 200px;
background: #73c8ff;
padding: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
#nav-main ul ul li { float: none; }
#nav-main ul ul li a {
font-size: 12px;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
padding: 4px 16px;
width: 168px; /* account for the width of ul#nav-main ul and the padding on the anchor */
display: inline-block;
#nav-main ul ul li a {
font-size: 12px;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
padding: 4px 16px;
width: 168px; /* account for the width of ul#nav-main ul and the padding on the anchor */
display: inline-block;
}
#nav-main ul ul li a:hover,
#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-ancestor > a,
#nav-main ul ul li a:hover,
#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-ancestor > a,
#nav-main ul ul li:hover > a {
color: #06c;
color: #06c;
}
#nav-main ul ul ul { left: 100%; top: 0; }
@@ -252,14 +252,14 @@ td { vertical-align: top; }
/* =============================================================================
Main content area
========================================================================== */
#main { position: relative; }
#main .container { padding: 0; }
#main .container { padding: 0; }
/* =============================================================================
Sidebar
========================================================================== */
#sidebar { position: relative; }
#sidebar .container { width: auto; padding: 0; }
#sidebar .widget { clear: both; margin-bottom: 1.5em; }
@@ -269,7 +269,7 @@ td { vertical-align: top; }
/* =============================================================================
Posts
========================================================================== */
.hentry header { margin-bottom: 1.5em; }
.hentry h1 { line-height: 1.2em; margin-bottom: 0.2em; }
.hentry h2:first-child { line-height: 1.2em; margin-bottom: 0; }
@@ -298,7 +298,7 @@ td { vertical-align: top; }
/* =============================================================================
Post comments
========================================================================== */
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 .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
========================================================================== */
figure.gallery-item { float: left; margin: 0 1em 1em 0; position: relative; }
figure.gallery-item a img {
border: 4px solid #bbb;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
-moz-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);
figure.gallery-item a img {
border: 4px solid #bbb;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
-moz-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);
}
figure.gallery-item a:hover img { border-color: #ccc; }
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 .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 .top_label .gfield_label { margin: 6px 0 0 0; }
.gform_wrapper .top_label input.medium { padding-right: 0; }
.gform_wrapper .left_label .gfield_label,
.gform_wrapper .right_label .gfield_label { margin: 10px 10px 0 0; }
.gform_wrapper .left_label ul.gfield_checkbox,
.gform_wrapper .left_label ul.gfield_radio,
.gform_wrapper .right_label ul.gfield_checkbox,
.gform_wrapper .left_label ul.gfield_checkbox,
.gform_wrapper .left_label ul.gfield_radio,
.gform_wrapper .right_label ul.gfield_checkbox,
.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=url],
@@ -368,18 +368,18 @@ figure.gallery-item figcaption { display: none; }
.gform_wrapper input[type=password],
.gform_wrapper textarea,
.gform_wrapper select {
font-size: 1em;
line-height: 14px;
padding: 4px;
margin: 6px 0;
border: 1px solid #bbb;
-moz-background-clip: padding;
-webkit-background-clip: padding;
background-clip: padding-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
vertical-align: middle;
font-size: 1em;
line-height: 14px;
padding: 4px;
margin: 6px 0;
border: 1px solid #bbb;
-moz-background-clip: padding;
-webkit-background-clip: padding;
background-clip: padding-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
vertical-align: middle;
}
.gform_wrapper input[type=text]: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 textarea:focus,
.gform_wrapper select:focus {
border: 1px solid #666;
border: 1px solid #666;
}
.gform_wrapper select { padding: 3px; }
.gform_wrapper .small, .gform_wrapper .large { font-size: 1em; line-height: 14px; }
.gform_wrapper ul.right_label li,
.gform_wrapper ul.left_label li,
.gform_wrapper form ul.right_label li,
.gform_wrapper ul.right_label li,
.gform_wrapper ul.left_label li,
.gform_wrapper form ul.right_label li,
.gform_wrapper form ul.left_label li {
margin-bottom: 4px;
margin-bottom: 4px;
}
.gform_wrapper .description,
.gform_wrapper .gfield_description,
.gform_wrapper .gsection_description,
.gform_wrapper .description,
.gform_wrapper .gfield_description,
.gform_wrapper .gsection_description,
.gform_wrapper .instruction {
font-size: 0.9em;
font-style: normal;
padding: 0;
font-size: 0.9em;
font-style: normal;
padding: 0;
}
.gform_wrapper .right_label .gfield_description,
.gform_wrapper .right_label .gfield_description,
.gform_wrapper .right_label .instruction,
.gform_wrapper .left_label .gfield_description,
.gform_wrapper .left_label .gfield_description,
.gform_wrapper .left_label .instruction {
padding: 0;
margin-left: 31%;
padding: 0;
margin-left: 31%;
}
.gform_wrapper .ginput_complex label,
.gform_wrapper .gfield_time_hour label,
.gform_wrapper .gfield_time_minute label,
.gform_wrapper .gfield_date_month label,
.gform_wrapper .gfield_date_day label,
.gform_wrapper .gfield_date_year label,
.gform_wrapper .ginput_complex label,
.gform_wrapper .gfield_time_hour label,
.gform_wrapper .gfield_time_minute label,
.gform_wrapper .gfield_date_month label,
.gform_wrapper .gfield_date_day label,
.gform_wrapper .gfield_date_year label,
.gform_wrapper .instruction {
font-size: 0.9em;
font-weight: 400;
letter-spacing: 0;
margin: 0 0 6px 0;
font-size: 0.9em;
font-weight: 400;
letter-spacing: 0;
margin: 0 0 6px 0;
}
.gform_wrapper .gfield_checkbox li input[type=checkbox],
.gform_wrapper .gfield_radio li input[type=radio],
.gform_wrapper .gfield_checkbox li input[type=checkbox],
.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 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_left label,
.gform_wrapper .right_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 .right_label .ginput_complex .ginput_right label,
.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; }
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_message { display: none; }
.gform_wrapper li.gfield.gfield_error {
background: none;
margin-bottom: 6px !important;
padding: 0 !important;
border: none;
background: none;
margin-bottom: 6px !important;
padding: 0 !important;
border: none;
}
.gform_wrapper .top_label .gfield_error .ginput_container { max-width: none; }
.gform_wrapper .top_label .gfield_error { margin-bottom: 0 !important; }
.gform_wrapper .gfield_error .gfield_label { color: #8a1f11; }
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error textarea { background: #FBE3E4; border-color: #FBC2C4; }
.gform_wrapper .top_label .gfield_error input,
.gform_wrapper .top_label .gfield_error textarea,
.gform_wrapper .top_label .gfield_error input,
.gform_wrapper .top_label .gfield_error textarea,
.gform_wrapper .top_label .gfield_error select { border-color: #FBC2C4; }
.gform_wrapper .top_label .gfield_error { width: auto; }
@@ -469,7 +469,7 @@ img.ui-datepicker-trigger { vertical-align: middle; }
/* =============================================================================
Search form
========================================================================== */
#searchform #s { padding: 5px; }
@@ -493,12 +493,12 @@ img.ui-datepicker-trigger { vertical-align: middle; }
========================================================================== */
@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) {
/* 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
========================================================================== */
@media print {
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; }
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; }
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}

View File

@@ -1,21 +1,21 @@
<?php roots_footer_before(); ?>
<footer id="content-info" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="contentinfo">
<?php roots_footer_inside(); ?>
<div class="container">
<?php dynamic_sidebar("Footer"); ?>
<p class="copy"><small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p>
</div>
</footer>
<?php roots_footer_after(); ?>
</div><!-- /#wrap -->
<?php roots_footer_before(); ?>
<footer id="content-info" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="contentinfo">
<?php roots_footer_inside(); ?>
<div class="container">
<?php dynamic_sidebar("Footer"); ?>
<p class="copy"><small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p>
</div>
</footer>
<?php roots_footer_after(); ?>
</div><!-- /#wrap -->
<?php wp_footer(); ?>
<?php roots_footer(); ?>
<!--[if lt IE 7]>
<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>
<![endif]-->
<!--[if lt IE 7]>
<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>
<![endif]-->
</body>
</html>
</html>

View File

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

View File

@@ -1,66 +1,66 @@
<?php // https://github.com/retlehs/roots/wiki
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-cleanup.php'; // cleanup
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-actions.php'; // actions
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-activation.php'; // activation
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-htaccess.php'; // rewrites for assets, h5bp htaccess
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-widgets.php'; // widgets
require_once get_template_directory() . '/inc/roots-custom.php'; // custom functions
$roots_options = roots_get_theme_options();
// set the maximum 'Large' image width to the maximum grid width
if (!isset($content_width)) {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
switch ($roots_css_framework) {
case 'blueprint': $content_width = 950; break;
case '960gs_12': $content_width = 940; break;
case '960gs_16': $content_width = 940; break;
case '960gs_24': $content_width = 940; break;
case '1140': $content_width = 1140; break;
case 'adapt': $content_width = 940; break;
default: $content_width = 950; break;
}
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
switch ($roots_css_framework) {
case 'blueprint': $content_width = 950; break;
case '960gs_12': $content_width = 940; break;
case '960gs_16': $content_width = 940; break;
case '960gs_24': $content_width = 940; break;
case '1140': $content_width = 1140; break;
case 'adapt': $content_width = 940; break;
default: $content_width = 950; break;
}
}
function roots_setup() {
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); }
load_theme_textdomain('roots', get_template_directory() . '/lang');
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')
));
// 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() { }
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');
@@ -68,18 +68,18 @@ add_action('after_setup_theme', 'roots_setup');
// create widget areas: sidebar, footer
$sidebars = array('Sidebar', 'Footer');
foreach ($sidebars as $sidebar) {
register_sidebar(array('name'=> $sidebar,
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">',
'after_widget' => '</div></article>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array('name'=> $sidebar,
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">',
'after_widget' => '</div></article>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
// return post entry meta information
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 '<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 '<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>';
}
?>
?>

View File

@@ -4,63 +4,63 @@
<!--[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]-->
<head>
<meta charset="utf-8">
<meta charset="utf-8">
<title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
<?php roots_stylesheets(); ?>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> Feed" href="<?php echo home_url(); ?>/feed/">
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="<?php echo get_template_directory_uri(); ?>/js/libs/modernizr-2.0.6.min.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 roots_stylesheets(); ?>
<?php wp_head(); ?>
<?php roots_head(); ?>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> Feed" href="<?php echo home_url(); ?>/feed/">
<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>
<script src="<?php echo get_template_directory_uri(); ?>/js/libs/modernizr-2.0.6.min.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>
<body <?php body_class(roots_body_class()); ?>>
<?php roots_wrap_before(); ?>
<div id="wrap" class="container" role="document">
<?php roots_header_before(); ?>
<header id="banner" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="banner">
<?php roots_header_inside(); ?>
<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 } ?>
<?php roots_wrap_before(); ?>
<div id="wrap" class="container" role="document">
<?php roots_header_before(); ?>
<header id="banner" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="banner">
<?php roots_header_inside(); ?>
<div class="container">
</div>
</header>
<?php roots_header_after(); ?>
<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>
</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_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');
function roots_google_analytics() {
global $roots_options;
$roots_google_analytics_id = $roots_options['google_analytics_id'];
$get_roots_google_analytics_id = esc_attr($roots_options['google_analytics_id']);
if ($roots_google_analytics_id !== '') {
echo "\n\t<script>\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\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</script>\n";
}
global $roots_options;
$roots_google_analytics_id = $roots_options['google_analytics_id'];
$get_roots_google_analytics_id = esc_attr($roots_options['google_analytics_id']);
if ($roots_google_analytics_id !== '') {
echo "\n\t<script>\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\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</script>\n";
}
}
function roots_fout_b_gone() {
global $roots_options;
$roots_fout_b_gone = $roots_options['fout_b_gone'];
$template_uri = get_template_directory_uri();
if ($roots_fout_b_gone === true) {
echo "\t<script src=\"$template_uri/js/libs/foutbgone.min.js\"></script>\n";
echo "\t<script>\n";
echo "\t\tfbg.hideFOUT('asap', 100);\n";
echo "\t</script>";
}
global $roots_options;
$roots_fout_b_gone = $roots_options['fout_b_gone'];
$template_uri = get_template_directory_uri();
if ($roots_fout_b_gone === true) {
echo "\t<script src=\"$template_uri/js/libs/foutbgone.min.js\"></script>\n";
echo "\t<script>\n";
echo "\t\tfbg.hideFOUT('asap', 100);\n";
echo "\t</script>";
}
}
function roots_1140_head() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
$template_uri = get_template_directory_uri();
if ($roots_css_framework === '1140') {
echo "\t<script src=\"$template_uri/js/libs/css3-mediaqueries.js\"></script>";
}
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
$template_uri = get_template_directory_uri();
if ($roots_css_framework === '1140') {
echo "\t<script src=\"$template_uri/js/libs/css3-mediaqueries.js\"></script>";
}
}
function roots_adapt_head() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
$template_uri = get_template_directory_uri();
if ($roots_css_framework === 'adapt') {
echo "\n\t<script>\n";
echo "\t\tvar ADAPT_CONFIG = {\n";
echo "\t\t\tpath: '$template_uri/css/adapt/',\n";
echo "\t\t\tdynamic: true,\n";
echo "\t\t\trange: [\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'980px to 1280px = 960.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'1920px = fluid.css'\n";
echo "\t\t\t]\n";
echo "\t\t};\n";
echo "\t</script>\n";
echo "\t<script src=\"$template_uri/js/libs/adapt.min.js\"></script>";
}
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
$template_uri = get_template_directory_uri();
if ($roots_css_framework === 'adapt') {
echo "\n\t<script>\n";
echo "\t\tvar ADAPT_CONFIG = {\n";
echo "\t\t\tpath: '$template_uri/css/adapt/',\n";
echo "\t\t\tdynamic: true,\n";
echo "\t\t\trange: [\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'980px to 1280px = 960.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'1920px = fluid.css'\n";
echo "\t\t\t]\n";
echo "\t\t};\n";
echo "\t</script>\n";
echo "\t<script src=\"$template_uri/js/libs/adapt.min.js\"></script>";
}
}
function roots_get_stylesheets() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
$styles = '';
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
$styles = '';
switch ($roots_css_framework) {
case 'blueprint' :
@@ -102,15 +102,15 @@ function roots_get_stylesheets() {
case 'less' :
$styles .= stylesheet_link_tag('/less/less.css');
break;
}
}
if (class_exists('RGForms')) {
$styles .= "\t<link rel=\"stylesheet\" href=\"" . plugins_url(). "/gravityforms/css/forms.css\">\n";
}
if (class_exists('RGForms')) {
$styles .= "\t<link rel=\"stylesheet\" href=\"" . plugins_url(). "/gravityforms/css/forms.css\">\n";
}
if (is_child_theme()) {
$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 {
$styles .= stylesheet_link_tag('/style.css', 1);
}
@@ -122,9 +122,9 @@ function roots_get_stylesheets() {
case '1140' :
$styles .= "\t<!--[if lt IE 8]>" . stylesheet_link_tag('/1140/ie.css', 0, false) . "<![endif]-->\n";
break;
}
}
echo $styles;
echo $styles;
}
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() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo '<div class="container"><div class="row">', "\n";
}
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo '<div class="container"><div class="row">', "\n";
}
}
function roots_1140_header_after() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n";
echo '<div class="container"><div class="row">', "\n";
}
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n";
echo '<div class="container"><div class="row">', "\n";
}
}
function roots_1140_footer_before() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n";
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n";
echo '<div class="container"><div class="row">', "\n";
}
}
}
function roots_1140_footer_after() {
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n";
}
global $roots_options;
$roots_css_framework = $roots_options['css_framework'];
if ($roots_css_framework === '1140') {
echo "</div></div><!-- /.row /.container -->\n";
}
}
function roots_page_breadcrumb() {
global $post;
if (function_exists('yoast_breadcrumb')) {
if (is_page() && $post->post_parent) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
}
}
global $post;
if (function_exists('yoast_breadcrumb')) {
if (is_page() && $post->post_parent) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
}
}
}
?>

View File

@@ -5,73 +5,73 @@
global $pagenow;
if (is_admin() && $pagenow === 'themes.php' && isset( $_GET['activated'])) {
// 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
// set WordPress to have the front page display the Home page as a static page
$default_pages = array('Home');
$existing_pages = get_pages();
// 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
// set WordPress to have the front page display the Home page as a static page
$default_pages = array('Home');
$existing_pages = get_pages();
$temp = array();
foreach ($existing_pages as $page) {
$temp[] = $page->post_title;
}
foreach ($existing_pages as $page) {
$temp[] = $page->post_title;
}
$pages_to_create = array_diff($default_pages, $temp);
foreach ($pages_to_create as $new_page_title) {
// create post object
$add_default_pages = array(
// create post object
$add_default_pages = array(
'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_status' => 'publish',
'post_type' => 'page'
);
// insert the post into the database
$result = wp_insert_post($add_default_pages);
}
$home = get_page_by_title('Home');
update_option('show_on_front', 'page');
update_option('page_on_front', $home->ID);
$home_menu_order = array(
// insert the post into the database
$result = wp_insert_post($add_default_pages);
}
$home = get_page_by_title('Home');
update_option('show_on_front', 'page');
update_option('page_on_front', $home->ID);
$home_menu_order = array(
'ID' => $home->ID,
'menu_order' => -1
);
wp_update_post($home_menu_order);
// set the permalink structure
if (get_option('permalink_structure') !== '/%year%/%postname%/') {
update_option('permalink_structure', '/%year%/%postname%/');
wp_update_post($home_menu_order);
// set the permalink structure
if (get_option('permalink_structure') !== '/%year%/%postname%/') {
update_option('permalink_structure', '/%year%/%postname%/');
}
$wp_rewrite->init();
$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;
$wp_rewrite->init();
$wp_rewrite->flush_rules();
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;
}
// don't organize uploads by year and month
update_option('uploads_use_yearmonth_folders', 0);
update_option('upload_path', 'assets');
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;
}
// automatically create menus and set their locations
// add all pages to the Primary Navigation
$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);
}
$primary_nav = wp_get_nav_menu_object('Primary Navigation');
$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/
// http://txfx.net/wordpress-plugins/nice-search/
function roots_nice_search_redirect() {
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);
exit();
}
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);
exit();
}
}
add_action('template_redirect', 'roots_nice_search_redirect');
function roots_search_query($escaped = true) {
$query = apply_filters('roots_search_query', get_query_var('s'));
if ($escaped) {
$query = esc_attr($query);
}
return urldecode($query);
$query = apply_filters('roots_search_query', get_query_var('s'));
if ($escaped) {
$query = esc_attr($query);
}
return urldecode($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/
// thanks to Scott Walkinshaw (scottwalkinshaw.com)
function roots_root_relative_url($input) {
$output = preg_replace_callback(
'!(https?://[^/|"]+)([^"]+)?!',
create_function(
'$matches',
// if full URL is site_url, return a slash for relative root
'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' .
// if domain is equal to site_url, then make URL relative
'} 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
'} else { return $matches[0]; };'
),
$input
);
return $output;
$output = preg_replace_callback(
'!(https?://[^/|"]+)([^"]+)?!',
create_function(
'$matches',
// if full URL is site_url, return a slash for relative root
'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' .
// if domain is equal to site_url, then make URL relative
'} 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
'} else { return $matches[0]; };'
),
$input
);
return $output;
}
// 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) {
$output = roots_root_relative_url($input);
preg_match_all('!([^/]+)/([^/]+)!', $output, $matches);
if (isset($matches[1]) && isset($matches[2])) {
if ($matches[1][0] === $matches[2][0]) {
$output = substr($output, strlen($matches[1][0]) + 1);
}
}
return $output;
$output = roots_root_relative_url($input);
preg_match_all('!([^/]+)/([^/]+)!', $output, $matches);
if (isset($matches[1]) && isset($matches[2])) {
if ($matches[1][0] === $matches[2][0]) {
$output = substr($output, strlen($matches[1][0]) + 1);
}
}
return $output;
}
$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']) {
add_filter('bloginfo_url', 'roots_root_relative_url');
add_filter('theme_root_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('script_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('the_permalink', '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_nav_menu', 'roots_root_relative_url');
add_filter('the_content_more_link', 'roots_root_relative_url');
add_filter('the_tags', 'roots_root_relative_url');
add_filter('get_pagenum_link', 'roots_root_relative_url');
add_filter('get_comment_link', 'roots_root_relative_url');
add_filter('month_link', 'roots_root_relative_url');
add_filter('day_link', 'roots_root_relative_url');
add_filter('year_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('bloginfo_url', 'roots_root_relative_url');
add_filter('theme_root_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('script_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('the_permalink', '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_nav_menu', 'roots_root_relative_url');
add_filter('the_content_more_link', 'roots_root_relative_url');
add_filter('the_tags', 'roots_root_relative_url');
add_filter('get_pagenum_link', 'roots_root_relative_url');
add_filter('get_comment_link', 'roots_root_relative_url');
add_filter('month_link', 'roots_root_relative_url');
add_filter('day_link', 'roots_root_relative_url');
add_filter('year_link', 'roots_root_relative_url');
add_filter('tag_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
function roots_root_relative_attachment_urls() {
$roots_options = roots_get_theme_options();
if (!is_feed() && $roots_options['root_relative_urls']) {
add_filter('wp_get_attachment_url', 'roots_root_relative_url');
add_filter('wp_get_attachment_link', 'roots_root_relative_url');
}
$roots_options = roots_get_theme_options();
if (!is_feed() && $roots_options['root_relative_urls']) {
add_filter('wp_get_attachment_url', 'roots_root_relative_url');
add_filter('wp_get_attachment_link', 'roots_root_relative_url');
}
}
add_action('pre_get_posts', 'roots_root_relative_attachment_urls');
// set lang="en" as default (rather than en-US)
function roots_language_attributes() {
$attributes = array();
$output = '';
if (function_exists('is_rtl')) {
if (is_rtl() == 'rtl') {
$attributes[] = 'dir="rtl"';
}
}
$lang = get_bloginfo('language');
if ($lang && $lang !== 'en-US') {
$attributes[] = "lang=\"$lang\"";
} else {
$attributes[] = 'lang="en"';
}
$attributes = array();
$output = '';
if (function_exists('is_rtl')) {
if (is_rtl() == 'rtl') {
$attributes[] = 'dir="rtl"';
}
}
$output = implode(' ', $attributes);
$output = apply_filters('roots_language_attributes', $output);
return $output;
$lang = get_bloginfo('language');
if ($lang && $lang !== 'en-US') {
$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');
@@ -119,173 +119,173 @@ add_filter('the_generator', 'roots_no_generator');
// cleanup wp_head
function roots_noindex() {
if (get_option('blog_public') === '0') {
echo '<meta name="robots" content="noindex,nofollow">', "\n";
}
}
if (get_option('blog_public') === '0') {
echo '<meta name="robots" content="noindex,nofollow">', "\n";
}
}
function roots_rel_canonical() {
if (!is_singular()) {
return;
}
if (!is_singular()) {
return;
}
global $wp_the_query;
if (!$id = $wp_the_query->get_queried_object_id()) {
return;
}
global $wp_the_query;
if (!$id = $wp_the_query->get_queried_object_id()) {
return;
}
$link = get_permalink($id);
echo "\t<link rel=\"canonical\" href=\"$link\">\n";
$link = get_permalink($id);
echo "\t<link rel=\"canonical\" href=\"$link\">\n";
}
// remove CSS from recent comments widget
function roots_remove_recent_comments_style() {
global $wp_widget_factory;
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'));
}
global $wp_widget_factory;
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 CSS from gallery
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() {
// http://wpengineer.com/1438/wordpress-header/
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'parent_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', 'wp_generator');
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action('wp_head', 'noindex', 1);
add_action('wp_head', 'roots_noindex');
remove_action('wp_head', 'rel_canonical');
add_action('wp_head', 'roots_rel_canonical');
add_action('wp_head', 'roots_remove_recent_comments_style', 1);
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);
}
// http://wpengineer.com/1438/wordpress-header/
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'parent_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', 'wp_generator');
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action('wp_head', 'noindex', 1);
add_action('wp_head', 'roots_noindex');
remove_action('wp_head', 'rel_canonical');
add_action('wp_head', 'roots_rel_canonical');
add_action('wp_head', 'roots_remove_recent_comments_style', 1);
add_filter('gallery_style', 'roots_gallery_style');
// deregister l10n.js (new since WordPress 3.1)
// 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);
}
// 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)
// 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');
// cleanup gallery_shortcode()
function roots_gallery_shortcode($attr) {
global $post, $wp_locale;
global $post, $wp_locale;
static $instance = 0;
$instance++;
static $instance = 0;
$instance++;
// Allow plugins/themes to override the default gallery template.
$output = apply_filters('post_gallery', '', $attr);
if ( $output != '' )
return $output;
// Allow plugins/themes to override the default gallery template.
$output = apply_filters('post_gallery', '', $attr);
if ( $output != '' )
return $output;
// We're trusting author input, so let's at least make sure it looks like a valid orderby statement
if ( isset( $attr['orderby'] ) ) {
$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
if ( !$attr['orderby'] )
unset( $attr['orderby'] );
}
// We're trusting author input, so let's at least make sure it looks like a valid orderby statement
if ( isset( $attr['orderby'] ) ) {
$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
if ( !$attr['orderby'] )
unset( $attr['orderby'] );
}
extract(shortcode_atts(array(
'order' => 'ASC',
'orderby' => 'menu_order ID',
'id' => $post->ID,
'icontag' => 'figure',
'captiontag' => 'figcaption',
'columns' => 3,
'size' => 'thumbnail',
'include' => '',
'exclude' => ''
), $attr));
extract(shortcode_atts(array(
'order' => 'ASC',
'orderby' => 'menu_order ID',
'id' => $post->ID,
'icontag' => 'figure',
'captiontag' => 'figcaption',
'columns' => 3,
'size' => 'thumbnail',
'include' => '',
'exclude' => ''
), $attr));
$id = intval($id);
if ( 'RAND' == $order )
$orderby = 'none';
$id = intval($id);
if ( 'RAND' == $order )
$orderby = 'none';
if ( !empty($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) );
if ( !empty($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 = array();
foreach ( $_attachments as $key => $val ) {
$attachments[$val->ID] = $_attachments[$key];
}
} elseif ( !empty($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) );
} else {
$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
}
$attachments = array();
foreach ( $_attachments as $key => $val ) {
$attachments[$val->ID] = $_attachments[$key];
}
} elseif ( !empty($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) );
} else {
$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
}
if ( empty($attachments) )
return '';
if ( empty($attachments) )
return '';
if ( is_feed() ) {
$output = "\n";
foreach ( $attachments as $att_id => $attachment )
$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
return $output;
}
if ( is_feed() ) {
$output = "\n";
foreach ( $attachments as $att_id => $attachment )
$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
return $output;
}
$captiontag = tag_escape($captiontag);
$columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
$float = is_rtl() ? 'right' : 'left';
$captiontag = tag_escape($captiontag);
$columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
$float = is_rtl() ? 'right' : 'left';
$selector = "gallery-{$instance}";
$selector = "gallery-{$instance}";
$gallery_style = $gallery_div = '';
if ( apply_filters( 'use_default_gallery_style', true ) )
$gallery_style = "";
$size_class = sanitize_html_class( $size );
$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 );
$gallery_style = $gallery_div = '';
if ( apply_filters( 'use_default_gallery_style', true ) )
$gallery_style = "";
$size_class = sanitize_html_class( $size );
$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 );
$i = 0;
foreach ( $attachments as $id => $attachment ) {
// make the gallery link to the file by default instead of the attachment
// thanks to Matt Price (countingrows.com)
$link = isset($attr['link']) && $attr['link'] === 'attachment' ?
wp_get_attachment_link($id, $size, true, false) :
$i = 0;
foreach ( $attachments as $id => $attachment ) {
// make the gallery link to the file by default instead of the attachment
// thanks to Matt Price (countingrows.com)
$link = isset($attr['link']) && $attr['link'] === 'attachment' ?
wp_get_attachment_link($id, $size, true, false) :
wp_get_attachment_link($id, $size, false, false);
$output .= "
<{$icontag} class=\"gallery-item\">
$link
";
if ( $captiontag && trim($attachment->post_excerpt) ) {
$output .= "
<{$captiontag} class=\"gallery-caption\">
" . wptexturize($attachment->post_excerpt) . "
</{$captiontag}>";
}
$output .= "</{$icontag}>";
if ( $columns > 0 && ++$i % $columns == 0 )
$output .= '';
}
$output .= "
<{$icontag} class=\"gallery-item\">
$link
";
if ( $captiontag && trim($attachment->post_excerpt) ) {
$output .= "
<{$captiontag} class=\"gallery-caption\">
" . wptexturize($attachment->post_excerpt) . "
</{$captiontag}>";
}
$output .= "</{$icontag}>";
if ( $columns > 0 && ++$i % $columns == 0 )
$output .= '';
}
$output .= "</section>\n";
$output .= "</section>\n";
return $output;
return $output;
}
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
function roots_remove_dashboard_widgets() {
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
remove_meta_box('dashboard_primary', 'dashboard', 'normal');
remove_meta_box('dashboard_secondary', 'dashboard', 'normal');
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
remove_meta_box('dashboard_primary', 'dashboard', 'normal');
remove_meta_box('dashboard_secondary', 'dashboard', 'normal');
}
add_action('admin_init', 'roots_remove_dashboard_widgets');
// excerpt cleanup
function roots_excerpt_length($length) {
return 40;
return 40;
}
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');
@@ -315,72 +315,72 @@ add_filter('excerpt_more', 'roots_excerpt_more');
// remove container from menus
function roots_nav_menu_args($args = '') {
$args['container'] = false;
return $args;
$args['container'] = false;
return $args;
}
add_filter('wp_nav_menu_args', 'roots_nav_menu_args');
class roots_nav_walker extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$slug = sanitize_title($item->title);
$slug = sanitize_title($item->title);
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$class_names = $value = '';
$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 = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
$id = apply_filters( 'nav_menu_item_id', 'menu-' . $slug, $item, $args );
$id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
$id = apply_filters( 'nav_menu_item_id', 'menu-' . $slug, $item, $args );
$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->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '</a>';
$item_output .= $args->after;
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '</a>';
$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) {
return preg_match('/current-menu/', $val);
return preg_match('/current-menu/', $val);
}
// add to robots.txt
// http://codex.wordpress.org/Search_Engine_Optimization_for_WordPress#Robots.txt_Optimization
function roots_robots() {
echo "Disallow: /cgi-bin\n";
echo "Disallow: /wp-admin\n";
echo "Disallow: /wp-includes\n";
echo "Disallow: /wp-content/plugins\n";
echo "Disallow: /plugins\n";
echo "Disallow: /wp-content/cache\n";
echo "Disallow: /wp-content/themes\n";
echo "Disallow: /trackback\n";
echo "Disallow: /feed\n";
echo "Disallow: /comments\n";
echo "Disallow: /category/*/*\n";
echo "Disallow: */trackback\n";
echo "Disallow: */feed\n";
echo "Disallow: */comments\n";
echo "Disallow: /*?*\n";
echo "Disallow: /*?\n";
echo "Allow: /wp-content/uploads\n";
echo "Allow: /assets";
echo "Disallow: /cgi-bin\n";
echo "Disallow: /wp-admin\n";
echo "Disallow: /wp-includes\n";
echo "Disallow: /wp-content/plugins\n";
echo "Disallow: /plugins\n";
echo "Disallow: /wp-content/cache\n";
echo "Disallow: /wp-content/themes\n";
echo "Disallow: /trackback\n";
echo "Disallow: /feed\n";
echo "Disallow: /comments\n";
echo "Disallow: /category/*/*\n";
echo "Disallow: */trackback\n";
echo "Disallow: */feed\n";
echo "Disallow: */comments\n";
echo "Disallow: /*?*\n";
echo "Disallow: /*?\n";
echo "Allow: /wp-content/uploads\n";
echo "Allow: /assets";
}
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:
// <img>, <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');
@@ -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
function roots_notice_tagline() {
global $current_user;
$user_id = $current_user->ID;
if (!get_user_meta($user_id, 'ignore_tagline_notice')) {
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 '</div>';
$user_id = $current_user->ID;
if (!get_user_meta($user_id, 'ignore_tagline_notice')) {
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 '</div>';
}
}
if (get_option('blogdescription') === 'Just another WordPress site') {
add_action('admin_notices', 'roots_notice_tagline');
if (get_option('blogdescription') === 'Just another WordPress site') {
add_action('admin_notices', 'roots_notice_tagline');
}
function roots_notice_tagline_ignore() {
global $current_user;
$user_id = $current_user->ID;
if (isset($_GET['tagline_notice_ignore']) && '0' == $_GET['tagline_notice_ignore']) {
add_user_meta($user_id, 'ignore_tagline_notice', 'true', true);
global $current_user;
$user_id = $current_user->ID;
if (isset($_GET['tagline_notice_ignore']) && '0' == $_GET['tagline_notice_ignore']) {
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
function roots_change_mce_options($options) {
$ext = 'pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]';
if (isset($initArray['extended_valid_elements'])) {
$options['extended_valid_elements'] .= ',' . $ext;
} else {
$options['extended_valid_elements'] = $ext;
}
return $options;
$ext = 'pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]';
if (isset($initArray['extended_valid_elements'])) {
$options['extended_valid_elements'] .= ',' . $ext;
} else {
$options['extended_valid_elements'] = $ext;
}
return $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) {
preg_match_all("!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches);
//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";
}
function roots_body_class() {
$term = get_queried_object();
if (is_single())
$cat = get_the_category();
if(!empty($cat))
return $cat[0]->slug;
elseif(isset($term->slug))
return $term->slug;
elseif(isset($term->page_name))
return $term->page_name;
elseif(isset($term->post_name))
return $term->post_name;
else
return;
$term = get_queried_object();
if (is_single())
$cat = get_the_category();
if(!empty($cat))
return $cat[0]->slug;
elseif(isset($term->slug))
return $term->slug;
elseif(isset($term->page_name))
return $term->page_name;
elseif(isset($term->post_name))
return $term->post_name;
else
return;
}
// first and last classes for widgets
// http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets
function roots_widget_first_last_classes($params) {
global $my_widget_num;
$this_id = $params[0]['id'];
$arr_registered_widgets = wp_get_sidebars_widgets();
global $my_widget_num;
$this_id = $params[0]['id'];
$arr_registered_widgets = wp_get_sidebars_widgets();
if (!$my_widget_num) {
$my_widget_num = array();
}
if (!$my_widget_num) {
$my_widget_num = array();
}
if (!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) {
return $params;
}
if (!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) {
return $params;
}
if (isset($my_widget_num[$this_id])) {
$my_widget_num[$this_id] ++;
} else {
$my_widget_num[$this_id] = 1;
}
if (isset($my_widget_num[$this_id])) {
$my_widget_num[$this_id] ++;
} else {
$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) {
$class .= 'widget-first ';
} elseif ($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) {
$class .= 'widget-last ';
}
if ($my_widget_num[$this_id] == 1) {
$class .= 'widget-first ';
} elseif ($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) {
$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');
?>
?>

View File

@@ -1,34 +1,34 @@
<?php
<?php
// header.php
function roots_head() { do_action('roots_head'); }
function roots_stylesheets() { do_action('roots_stylesheets'); }
function roots_wrap_before() { do_action('roots_wrap_before'); }
function roots_header_before() { do_action('roots_header_before'); }
function roots_header_inside() { do_action('roots_header_inside'); }
function roots_header_after() { do_action('roots_header_after'); }
function roots_head() { do_action('roots_head'); }
function roots_stylesheets() { do_action('roots_stylesheets'); }
function roots_wrap_before() { do_action('roots_wrap_before'); }
function roots_header_before() { do_action('roots_header_before'); }
function roots_header_inside() { do_action('roots_header_inside'); }
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
// 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_after() { do_action('roots_content_after'); }
function roots_main_before() { do_action('roots_main_before'); }
function roots_main_after() { do_action('roots_main_after'); }
function roots_post_before() { do_action('roots_post_before'); }
function roots_post_after() { do_action('roots_post_after'); }
function roots_post_inside_before() { do_action('roots_post_inside_before'); }
function roots_post_inside_after() { do_action('roots_post_inside_after'); }
function roots_loop_before() { do_action('roots_loop_before'); }
function roots_loop_after() { do_action('roots_loop_after'); }
function roots_sidebar_before() { do_action('roots_sidebar_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_after() { do_action('roots_sidebar_after'); }
function roots_content_before() { do_action('roots_content_before'); }
function roots_content_after() { do_action('roots_content_after'); }
function roots_main_before() { do_action('roots_main_before'); }
function roots_main_after() { do_action('roots_main_after'); }
function roots_post_before() { do_action('roots_post_before'); }
function roots_post_after() { do_action('roots_post_after'); }
function roots_post_inside_before() { do_action('roots_post_inside_before'); }
function roots_post_inside_after() { do_action('roots_post_inside_after'); }
function roots_loop_before() { do_action('roots_loop_before'); }
function roots_loop_after() { do_action('roots_loop_after'); }
function roots_sidebar_before() { do_action('roots_sidebar_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_after() { do_action('roots_sidebar_after'); }
// 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_after() { do_action('roots_footer_after'); }
function roots_footer() { do_action('roots_footer'); }
?>
?>

View File

@@ -5,82 +5,82 @@
// https://github.com/retlehs/roots/wiki/Lighttpd
if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') !== false) {
function roots_htaccess_writable() {
if (!is_writable(get_home_path() . '.htaccess')) {
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>';"));
}
};
}
function roots_htaccess_writable() {
if (!is_writable(get_home_path() . '.htaccess')) {
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_init', 'roots_htaccess_writable');
add_action('admin_init', 'roots_htaccess_writable');
// Rewrites DO NOT happen for child themes
// rewrite /wp-content/themes/roots/css/ to /css/
// rewrite /wp-content/themes/roots/js/ to /js/
// rewrite /wp-content/themes/roots/img/ to /js/
// rewrite /wp-content/plugins/ to /plugins/
// Rewrites DO NOT happen for child themes
// rewrite /wp-content/themes/roots/css/ to /css/
// rewrite /wp-content/themes/roots/js/ to /js/
// rewrite /wp-content/themes/roots/img/ to /js/
// rewrite /wp-content/plugins/ to /plugins/
function roots_flush_rewrites() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
function roots_flush_rewrites() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
function roots_add_rewrites($content) {
$theme_name = next(explode('/themes/', get_stylesheet_directory()));
global $wp_rewrite;
$roots_new_non_wp_rules = array(
'css/(.*)' => 'wp-content/themes/'. $theme_name . '/css/$1',
'js/(.*)' => 'wp-content/themes/'. $theme_name . '/js/$1',
'img/(.*)' => 'wp-content/themes/'. $theme_name . '/img/$1',
'plugins/(.*)' => 'wp-content/plugins/$1'
);
$wp_rewrite->non_wp_rules += $roots_new_non_wp_rules;
}
function roots_add_rewrites($content) {
$theme_name = next(explode('/themes/', get_stylesheet_directory()));
global $wp_rewrite;
$roots_new_non_wp_rules = array(
'css/(.*)' => 'wp-content/themes/'. $theme_name . '/css/$1',
'js/(.*)' => 'wp-content/themes/'. $theme_name . '/js/$1',
'img/(.*)' => 'wp-content/themes/'. $theme_name . '/img/$1',
'plugins/(.*)' => 'wp-content/plugins/$1'
);
$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) {
$theme_name = next(explode('/themes/', $content));
$current_path = '/wp-content/themes/' . $theme_name;
$new_path = '';
$content = str_replace($current_path, $new_path, $content);
return $content;
}
function roots_clean_assets($content) {
$theme_name = next(explode('/themes/', $content));
$current_path = '/wp-content/themes/' . $theme_name;
$new_path = '';
$content = str_replace($current_path, $new_path, $content);
return $content;
}
function roots_clean_plugins($content) {
$current_path = '/wp-content/plugins';
$new_path = '/plugins';
$content = str_replace($current_path, $new_path, $content);
return $content;
}
function roots_clean_plugins($content) {
$current_path = '/wp-content/plugins';
$new_path = '/plugins';
$content = str_replace($current_path, $new_path, $content);
return $content;
}
// only use clean urls if the theme isn't a child or an MU (Network) install
if (!is_multisite() && !is_child_theme()) {
add_action('generate_rewrite_rules', 'roots_add_rewrites');
if (!is_admin()) {
add_filter('plugins_url', 'roots_clean_plugins');
add_filter('bloginfo', 'roots_clean_assets');
add_filter('stylesheet_directory_uri', 'roots_clean_assets');
add_filter('template_directory_uri', 'roots_clean_assets');
add_filter('script_loader_src', 'roots_clean_plugins');
add_filter('style_loader_src', 'roots_clean_plugins');
}
}
// only use clean urls if the theme isn't a child or an MU (Network) install
if (!is_multisite() && !is_child_theme()) {
add_action('generate_rewrite_rules', 'roots_add_rewrites');
if (!is_admin()) {
add_filter('plugins_url', 'roots_clean_plugins');
add_filter('bloginfo', 'roots_clean_assets');
add_filter('stylesheet_directory_uri', 'roots_clean_assets');
add_filter('template_directory_uri', 'roots_clean_assets');
add_filter('script_loader_src', 'roots_clean_plugins');
add_filter('style_loader_src', 'roots_clean_plugins');
}
}
function roots_add_h5bp_htaccess($rules) {
global $wp_filesystem;
function roots_add_h5bp_htaccess($rules) {
global $wp_filesystem;
if (!defined('FS_METHOD')) define('FS_METHOD', 'direct');
if (is_null($wp_filesystem)) WP_Filesystem(array(), ABSPATH);
if (!defined('FS_METHOD')) define('FS_METHOD', 'direct');
if (is_null($wp_filesystem)) WP_Filesystem(array(), ABSPATH);
$filename = __DIR__ . '/h5bp-htaccess';
$rules .= $wp_filesystem->get_contents($filename);
$filename = __DIR__ . '/h5bp-htaccess';
$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
function roots_admin_enqueue_scripts($hook_suffix) {
if ($hook_suffix !== 'appearance_page_theme_options')
return;
if ($hook_suffix !== 'appearance_page_theme_options')
return;
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_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');
}
add_action('admin_enqueue_scripts', 'roots_admin_enqueue_scripts');
function roots_theme_options_init() {
if (false === roots_get_theme_options())
add_option('roots_theme_options', roots_get_default_theme_options());
if (false === roots_get_theme_options())
add_option('roots_theme_options', roots_get_default_theme_options());
register_setting(
'roots_options',
'roots_theme_options',
'roots_theme_options_validate'
);
register_setting(
'roots_options',
'roots_theme_options',
'roots_theme_options_validate'
);
}
add_action('admin_init', 'roots_theme_options_init');
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');
function roots_theme_options_add_page() {
$theme_page = add_theme_page(
__('Theme Options', 'roots'),
__('Theme Options', 'roots'),
'edit_theme_options',
'theme_options',
'roots_theme_options_render_page'
);
$theme_page = add_theme_page(
__('Theme Options', 'roots'),
__('Theme Options', 'roots'),
'edit_theme_options',
'theme_options',
'roots_theme_options_render_page'
);
if (!$theme_page)
return;
if (!$theme_page)
return;
}
add_action('admin_menu', 'roots_theme_options_add_page');
function roots_admin_bar_render() {
global $wp_admin_bar;
global $wp_admin_bar;
$wp_admin_bar->add_menu(array(
'parent' => 'appearance',
'id' => 'theme_options',
'title' => __('Theme Options', 'roots'),
'href' => admin_url( 'themes.php?page=theme_options')
));
$wp_admin_bar->add_menu(array(
'parent' => 'appearance',
'id' => 'theme_options',
'title' => __('Theme Options', 'roots'),
'href' => admin_url( 'themes.php?page=theme_options')
));
}
add_action('wp_before_admin_bar_render', 'roots_admin_bar_render');
global $roots_css_frameworks;
$roots_css_frameworks = array(
'blueprint' => array(
'name' => 'blueprint',
'label' => __('Blueprint CSS', 'roots'),
'classes' => array(
'container' => 'span-24',
'main' => 'span-14 append-1',
'sidebar' => 'span-8 prepend-1 last'
)
),
'960gs_12' => array(
'name' => '960gs_12',
'label' => __('960gs (12 cols)', 'roots'),
'classes' => array(
'container' => 'container_12',
'main' => 'grid_7 suffix_1',
'sidebar' => 'grid_4'
)
),
'960gs_16' => array(
'name' => '960gs_16',
'label' => __('960gs (16 cols)', 'roots'),
'classes' => array(
'container' => 'container_16',
'main' => 'grid_9 suffix_1',
'sidebar' => 'grid_6'
)
),
'960gs_24' => array(
'name' => '960gs_24',
'label' => __('960gs (24 cols)', 'roots'),
'classes' => array(
'container' => 'container_24',
'main' => 'grid_15 suffix_1',
'sidebar' => 'grid_8'
)
),
'1140' => array(
'name' => '1140',
'label' => __('1140', 'roots'),
'classes' => array(
'container' => 'twelvecol',
'main' => 'eightcol',
'sidebar' => 'fourcol last'
)
),
'adapt' => array(
'name' => 'adapt',
'label' => __('Adapt.js', 'roots'),
'classes' => array(
'container' => 'container_12 clearfix',
'main' => 'grid_7 suffix_1',
'sidebar' => 'grid_4'
)
),
'less' => array(
'name' => 'less',
'label' => __('Less Framework 4', 'roots'),
'classes' => array(
'container' => 'container',
'main' => '',
'sidebar' => ''
)
),
'none' => array(
'name' => 'none',
'label' => __('None', 'roots'),
'classes' => array(
'container' => '',
'main' => '',
'sidebar' => ''
)
)
'blueprint' => array(
'name' => 'blueprint',
'label' => __('Blueprint CSS', 'roots'),
'classes' => array(
'container' => 'span-24',
'main' => 'span-14 append-1',
'sidebar' => 'span-8 prepend-1 last'
)
),
'960gs_12' => array(
'name' => '960gs_12',
'label' => __('960gs (12 cols)', 'roots'),
'classes' => array(
'container' => 'container_12',
'main' => 'grid_7 suffix_1',
'sidebar' => 'grid_4'
)
),
'960gs_16' => array(
'name' => '960gs_16',
'label' => __('960gs (16 cols)', 'roots'),
'classes' => array(
'container' => 'container_16',
'main' => 'grid_9 suffix_1',
'sidebar' => 'grid_6'
)
),
'960gs_24' => array(
'name' => '960gs_24',
'label' => __('960gs (24 cols)', 'roots'),
'classes' => array(
'container' => 'container_24',
'main' => 'grid_15 suffix_1',
'sidebar' => 'grid_8'
)
),
'1140' => array(
'name' => '1140',
'label' => __('1140', 'roots'),
'classes' => array(
'container' => 'twelvecol',
'main' => 'eightcol',
'sidebar' => 'fourcol last'
)
),
'adapt' => array(
'name' => 'adapt',
'label' => __('Adapt.js', 'roots'),
'classes' => array(
'container' => 'container_12 clearfix',
'main' => 'grid_7 suffix_1',
'sidebar' => 'grid_4'
)
),
'less' => array(
'name' => 'less',
'label' => __('Less Framework 4', 'roots'),
'classes' => array(
'container' => 'container',
'main' => '',
'sidebar' => ''
)
),
'none' => array(
'name' => 'none',
'label' => __('None', 'roots'),
'classes' => array(
'container' => '',
'main' => '',
'sidebar' => ''
)
)
);
// Write the above array of CSS frameworks into a script tag
function roots_add_frameworks_object_script() {
global $roots_css_frameworks;
$json = json_encode($roots_css_frameworks);
global $roots_css_frameworks;
$json = json_encode($roots_css_frameworks);
?>
<script>
var roots_css_frameworks = <?php echo $json; ?>;
</script>
<?php
<script>
var roots_css_frameworks = <?php echo $json; ?>;
</script>
<?php
}
add_action('admin_head', 'roots_add_frameworks_object_script');
function roots_get_default_theme_options($default_framework = '') {
global $roots_css_frameworks;
if ($default_framework == '') { $default_framework = apply_filters('roots_default_css_framework', 'blueprint'); }
$default_framework_settings = $roots_css_frameworks[$default_framework];
$default_theme_options = array(
'css_framework' => $default_framework,
'container_class' => $default_framework_settings['classes']['container'],
'main_class' => $default_framework_settings['classes']['main'],
'sidebar_class' => $default_framework_settings['classes']['sidebar'],
'google_analytics_id' => '',
'root_relative_urls' => true,
'clean_menu' => true,
'fout_b_gone' => false
);
global $roots_css_frameworks;
if ($default_framework == '') { $default_framework = apply_filters('roots_default_css_framework', 'blueprint'); }
$default_framework_settings = $roots_css_frameworks[$default_framework];
$default_theme_options = array(
'css_framework' => $default_framework,
'container_class' => $default_framework_settings['classes']['container'],
'main_class' => $default_framework_settings['classes']['main'],
'sidebar_class' => $default_framework_settings['classes']['sidebar'],
'google_analytics_id' => '',
'root_relative_urls' => true,
'clean_menu' => true,
'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() {
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() {
global $roots_css_frameworks;
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php printf(__('%s Theme Options', 'roots'), get_current_theme()); ?></h2>
<?php settings_errors(); ?>
global $roots_css_frameworks;
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php printf(__('%s Theme Options', 'roots'), get_current_theme()); ?></h2>
<?php settings_errors(); ?>
<form method="post" action="options.php">
<?php
settings_fields('roots_options');
$roots_options = roots_get_theme_options();
$roots_default_options = roots_get_default_theme_options($roots_options['css_framework']);
?>
<form method="post" action="options.php">
<?php
settings_fields('roots_options');
$roots_options = roots_get_theme_options();
$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>
<td>
<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]">
<?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>
<?php } ?>
</select>
</fieldset>
</td>
</tr>
<tr valign="top" class="radio-option"><th scope="row"><?php _e('CSS Grid Framework', 'roots'); ?></th>
<td>
<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]">
<?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>
<?php } ?>
</select>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('#main CSS Classes', 'roots'); ?></th>
<td>
<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" />
<br />
<small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['main_class']; ?></span></small>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('#main CSS Classes', 'roots'); ?></th>
<td>
<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" />
<br />
<small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['main_class']; ?></span></small>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('#sidebar CSS Classes', 'roots'); ?></th>
<td>
<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" />
<br />
<small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['sidebar_class']; ?></span></small>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('#sidebar CSS Classes', 'roots'); ?></th>
<td>
<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" />
<br />
<small class="description"><?php _e('Default:', 'roots'); ?> <span><?php echo $roots_default_options['sidebar_class']; ?></span></small>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Google Analytics ID', 'roots'); ?></th>
<td>
<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']); ?>" />
<br />
<small class="description"><?php printf(__('Enter your UA-XXXXX-X ID', 'roots')); ?></small>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Google Analytics ID', 'roots'); ?></th>
<td>
<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']); ?>" />
<br />
<small class="description"><?php printf(__('Enter your UA-XXXXX-X ID', 'roots')); ?></small>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Enable Root Relative URLs', 'roots'); ?></th>
<td>
<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]">
<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>
</select>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Enable Root Relative URLs', 'roots'); ?></th>
<td>
<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]">
<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>
</select>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Cleanup Menu Output', 'roots'); ?></th>
<td>
<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]">
<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>
</select>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Cleanup Menu Output', 'roots'); ?></th>
<td>
<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]">
<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>
</select>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Enable FOUT-B-Gone', 'roots'); ?></th>
<td>
<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]">
<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>
</select>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Enable FOUT-B-Gone', 'roots'); ?></th>
<td>
<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]">
<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>
</select>
</fieldset>
</td>
</tr>
</table>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php submit_button(); ?>
</form>
</div>
<?php
<?php
}
function roots_theme_options_validate($input) {
global $roots_css_frameworks;
$output = $defaults = roots_get_default_theme_options();
global $roots_css_frameworks;
$output = $defaults = roots_get_default_theme_options();
if (isset($input['css_framework']) && array_key_exists($input['css_framework'], $roots_css_frameworks))
$output['css_framework'] = $input['css_framework'];
if (isset($input['css_framework']) && array_key_exists($input['css_framework'], $roots_css_frameworks))
$output['css_framework'] = $input['css_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'];
// 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'];
if (isset($input['main_class'])) {
$output['main_class'] = wp_filter_nohtml_kses($input['main_class']);
}
if (isset($input['main_class'])) {
$output['main_class'] = wp_filter_nohtml_kses($input['main_class']);
}
if (isset($input['sidebar_class'])) {
$output['sidebar_class'] = wp_filter_nohtml_kses($input['sidebar_class']);
}
if (isset($input['sidebar_class'])) {
$output['sidebar_class'] = wp_filter_nohtml_kses($input['sidebar_class']);
}
if (isset($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'];
}
}
if (isset($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'];
}
}
if (isset($input['root_relative_urls'])) {
if ($input['root_relative_urls'] === 'yes') {
$input['root_relative_urls'] = true;
}
if ($input['root_relative_urls'] === 'no') {
$input['root_relative_urls'] = false;
}
$output['root_relative_urls'] = $input['root_relative_urls'];
}
if (isset($input['root_relative_urls'])) {
if ($input['root_relative_urls'] === 'yes') {
$input['root_relative_urls'] = true;
}
if ($input['root_relative_urls'] === 'no') {
$input['root_relative_urls'] = false;
}
$output['root_relative_urls'] = $input['root_relative_urls'];
}
if (isset($input['clean_menu'])) {
if ($input['clean_menu'] === 'yes') {
$input['clean_menu'] = true;
}
if ($input['clean_menu'] === 'no') {
$input['clean_menu'] = false;
}
$output['clean_menu'] = $input['clean_menu'];
}
if (isset($input['clean_menu'])) {
if ($input['clean_menu'] === 'yes') {
$input['clean_menu'] = true;
}
if ($input['clean_menu'] === 'no') {
$input['clean_menu'] = false;
}
$output['clean_menu'] = $input['clean_menu'];
}
if (isset($input['fout_b_gone'])) {
if ($input['fout_b_gone'] === 'yes') {
$input['fout_b_gone'] = true;
}
if ($input['fout_b_gone'] === 'no') {
$input['fout_b_gone'] = false;
}
$output['fout_b_gone'] = $input['fout_b_gone'];
}
if (isset($input['fout_b_gone'])) {
if ($input['fout_b_gone'] === 'yes') {
$input['fout_b_gone'] = true;
}
if ($input['fout_b_gone'] === 'no') {
$input['fout_b_gone'] = false;
}
$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 {
function roots_vcard() {
$widget_ops = array('description' => 'Display a vCard');
parent::WP_Widget(false, __('Roots: vCard', 'roots'), $widget_ops);
}
function roots_vcard() {
$widget_ops = array('description' => 'Display a vCard');
parent::WP_Widget(false, __('Roots: vCard', 'roots'), $widget_ops);
}
function widget($args, $instance) {
extract($args);
extract($instance);
echo $before_widget;
if ($title) {
echo $before_title, $title, $after_title;
}
function widget($args, $instance) {
extract($args);
extract($instance);
echo $before_widget;
if ($title) {
echo $before_title, $title, $after_title;
}
?>
<p class="vcard">
<a class="fn org url" href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a><br>
<span class="adr">
<span class="street-address"><?php echo $street_address; ?></span><br>
<span class="locality"><?php echo $locality; ?></span>,
<span class="region"><?php echo $region; ?></span>
<span class="postal-code"><?php echo $postal_code; ?></span><br>
</span>
<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>
</p>
<p class="vcard">
<a class="fn org url" href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a><br>
<span class="adr">
<span class="street-address"><?php echo $street_address; ?></span><br>
<span class="locality"><?php echo $locality; ?></span>,
<span class="region"><?php echo $region; ?></span>
<span class="postal-code"><?php echo $postal_code; ?></span><br>
</span>
<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>
</p>
<?php
echo $after_widget;
}
echo $after_widget;
}
function update($new_instance, $old_instance) {
return $new_instance;
}
function update($new_instance, $old_instance) {
return $new_instance;
}
function form($instance) {
?>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<?php
}
function form($instance) {
?>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<p>
<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'); } ?>" />
</p>
<?php
}
}
register_widget('roots_vcard');
?>
?>

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
<?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?>
<?php roots_post_inside_before(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
<?php roots_post_inside_after(); ?>
<?php roots_post_after(); ?>
<?php endwhile; // End the loop ?>
<?php roots_post_before(); ?>
<?php roots_post_inside_before(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
<?php roots_post_inside_after(); ?>
<?php roots_post_after(); ?>
<?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 (!have_posts()) : ?>
<div class="notice">
<p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div>
<?php get_search_form(); ?>
<div class="notice">
<p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php roots_post_inside_before(); ?>
<header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php roots_entry_meta(); ?>
</header>
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
<footer>
<?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?>
</footer>
<?php roots_post_inside_after(); ?>
</article>
<?php roots_post_after(); ?>
<?php roots_post_before(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php roots_post_inside_before(); ?>
<header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php roots_entry_meta(); ?>
</header>
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
<footer>
<?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?>
</footer>
<?php roots_post_inside_after(); ?>
</article>
<?php roots_post_after(); ?>
<?php endwhile; // End the loop ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav id="post-nav">
<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>
</nav>
<?php endif; ?>
<nav id="post-nav">
<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>
</nav>
<?php endif; ?>

View File

@@ -1,21 +1,21 @@
<?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<?php roots_post_inside_before(); ?>
<header>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php roots_entry_meta(); ?>
</header>
<div class="entry-content">
<?php the_content(); ?>
</div>
<footer>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
<p><?php the_tags(); ?></p>
</footer>
<?php comments_template(); ?>
<?php roots_post_inside_after(); ?>
</article>
<?php roots_post_after(); ?>
<?php endwhile; // End the loop ?>
<?php roots_post_before(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<?php roots_post_inside_before(); ?>
<header>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php roots_entry_meta(); ?>
</header>
<div class="entry-content">
<?php the_content(); ?>
</div>
<footer>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>' )); ?>
<p><?php the_tags(); ?></p>
</footer>
<?php comments_template(); ?>
<?php roots_post_inside_after(); ?>
</article>
<?php roots_post_after(); ?>
<?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 (!have_posts()) : ?>
<div class="notice">
<p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div>
<?php get_search_form(); ?>
<div class="notice">
<p class="bottom"><?php _e('Sorry, no results were found.', 'roots'); ?></p>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<?php /* Start loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php roots_post_before(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php roots_post_inside_before(); ?>
<header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php roots_entry_meta(); ?>
</header>
<div class="entry-content">
<?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?>
<?php the_excerpt(); ?>
<?php else : ?>
<?php the_content(); ?>
<?php endif; ?>
</div>
<footer>
<?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?>
</footer>
<?php roots_post_inside_after(); ?>
</article>
<?php roots_post_after(); ?>
<?php roots_post_before(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php roots_post_inside_before(); ?>
<header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php roots_entry_meta(); ?>
</header>
<div class="entry-content">
<?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?>
<?php the_excerpt(); ?>
<?php else : ?>
<?php the_content(); ?>
<?php endif; ?>
</div>
<footer>
<?php $tag = get_the_tags(); if (!$tag) { } else { ?><p><?php the_tags(); ?></p><?php } ?>
</footer>
<?php roots_post_inside_after(); ?>
</article>
<?php roots_post_after(); ?>
<?php endwhile; // End the loop ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav id="post-nav">
<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>
</nav>
<?php endif; ?>
<nav id="post-nav">
<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>
</nav>
<?php endif; ?>

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
<form role="search" method="get" id="searchform" action="<?php echo home_url('/'); ?>">
<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="submit" id="searchsubmit" value="<?php _e('Search', 'roots'); ?>" class="button">
</form>
<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="submit" id="searchsubmit" value="<?php _e('Search', 'roots'); ?>" class="button">
</form>

View File

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