Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Version 1.0. using external plugin now for functions. only work from …

…theme folder. remove some template files, to follow DRY.
  • Loading branch information...
commit 1bdfc1a1df3e247b985b902cb0e733145943a083 1 parent 8510c68
@chrisvanpatten chrisvanpatten authored
Showing with 113 additions and 700 deletions.
  1. +2 −1  .gitignore
  2. +0 −46 .maintenance
  3. +1 −1  LICENSE.md
  4. +8 −1 README.md
  5. 0  {wp-content/themes/themename → }/comments.php
  6. +2 −2 {wp-content/themes/themename → }/config.rb
  7. +1 −1  {wp-content/themes/themename → }/footer.php
  8. 0  wp-content/themes/themename/sass/includes/_fonts.scss → frontpage.php
  9. +32 −0 functions.php
  10. +5 −6 {wp-content/themes/themename → }/head.php
  11. +3 −0  header.php
  12. +0 −6 humans.txt
  13. 0  {wp-content/themes/themename → }/img/opengraph.png
  14. +11 −1 {wp-content/themes/themename → }/index.php
  15. 0  {wp-content/themes/themename → }/js/script.js
  16. 0  {wp-content/themes/themename → }/loop-page.php
  17. +3 −3 {wp-content/themes/themename → }/loop-post.php
  18. +0 −6 robots.txt
  19. +2 −2 {wp-content/themes/themename → }/sass/editor-style.scss
  20. +34 −0 sass/global.scss
  21. 0  wp-content/themes/themename/css/global.css → sass/includes/_definitions.scss
  22. 0  wp-content/themes/themename/css/editor-style.css → sass/includes/_fonts.scss
  23. 0  {wp-content/themes/themename → }/sass/includes/_media-queries.scss
  24. 0  {wp-content/themes/themename → }/sass/includes/rach5/_definitions.scss
  25. 0  {wp-content/themes/themename → }/sass/includes/rach5/_fixes.scss
  26. +9 −0 style.css
  27. +0 −100 wp-content/maintenance.php
  28. +0 −15 wp-content/themes/themename/front-page.php
  29. +0 −40 wp-content/themes/themename/functions.php
  30. +0 −5 wp-content/themes/themename/header.php
  31. +0 −48 wp-content/themes/themename/inc/rach5-admin.php
  32. +0 −142 wp-content/themes/themename/inc/rach5-clean.php
  33. +0 −95 wp-content/themes/themename/inc/rach5-functions.php
  34. +0 −57 wp-content/themes/themename/inc/rach5-htaccess.php
  35. +0 −47 wp-content/themes/themename/inc/rach5-html5.php
  36. +0 −17 wp-content/themes/themename/page.php
  37. +0 −32 wp-content/themes/themename/sass/global.scss
  38. +0 −17 wp-content/themes/themename/single.php
  39. +0 −9 wp-content/themes/themename/style.css
View
3  .gitignore
@@ -1 +1,2 @@
-.DS_Store
+.DS_Store
+.sass-cache
View
46 .maintenance
@@ -1,46 +0,0 @@
-<?php
-/*
-
- // What will your query string be?
- $name = 'open';
-
- // Is the user logged in or do they have the appropriate cookie?
- function is_user_logged_in() {
- $loggedin = false;
- foreach ( (array) $_COOKIE as $cookie => $value ) {
- if ( stristr($cookie, 'wordpress_logged_in_') || stristr($cookie, 'vpm_wordpress_') ) {
- $loggedin = true;
- }
- }
- return $loggedin;
- }
-
- // What page are we on?
- function curPageURL() {
- $pageURL = 'http';
- if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
- $pageURL .= "://";
- if ($_SERVER["SERVER_PORT"] != "80") {
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
- } else {
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
- }
- return $pageURL;
- }
-
- // Does this page have a URL query variable set?
- function url_get_param($name) {
- parse_str(parse_url(curPageURL(), PHP_URL_QUERY), $vars);
- return isset($vars[$name]) ? $vars[$name] : null;
- }
-
- // If none of these conditions are true, we're in maintenance!
- // If the query variable is set, set a cookie to expire in 30 minutes.
- if ( ! stristr($_SERVER['REQUEST_URI'], '/wp-admin') && ! stristr($_SERVER['REQUEST_URI'], '/wp-login.php') && ! is_user_logged_in() && ! url_get_param($name) ) {
- $upgrading = time();
- } elseif ( url_get_param('open') ) {
- setcookie("vpm_wordpress_hide_maintenance", "vanpattenmedia.com", time()+1800);
- }
-
-*/
-?>
View
2  LICENSE.md
@@ -1,5 +1,5 @@
### License
-**Copyright (C) 2011, Chris Van Patten.**
+**Copyright (C) 2011-2012, Chris Van Patten.**
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
View
9 README.md
@@ -5,7 +5,14 @@
Rach5 provides a set of "sensible defaults" that make it faster to jump into developing a custom WordPress website, and get right out of your way as quickly as possible by not imposing any (well, almost any) style decisions. Rach5 uses HTML5, Ruby and Compass, and a mix of WordPress native and custom functions that make theme development fast and fun.
-For up-to-date documentation, visit the Rach5 website at <a href="http://labs.vanpattenmedia.com/projects/rach5/">Van Patten Media Labs</a> or the <a href="https://github.com/vanpattenmedia/rach5/wiki">Github Wiki</a> for the project.
+### 1.0
+Rach5 has finally hit 1.0! What does that mean for you?
+
+* All the functions have been removed. They will now be maintained in a separate project: `rach5-plugin`.
+* The project has been condensed to only include the theme directory to simplify management via version control. The plugin will be built to handle maintenance and offer humans.txt/robots.txt defaults.
+* In the interest of maintainability and simplicity, I have removed several template files and condensed them down to loop templates that are called from conditionals in `index.php`. This logic is not typical for WordPress, but is a major part of bringing <a href="https://en.wikipedia.org/wiki/DRY">DRY</a> to Rach5.
+
+For up-to-date documentation, visit the Rach5 website at <a href="http://www.vanpattenmedia.com/projects/rach5/">Van Patten Media Labs</a> or the <a href="https://github.com/vanpattenmedia/rach5/wiki">Github Wiki</a> for the project.
### Getting started
It's easy to <a href="https://github.com/vanpattenmedia/rach5/wiki/Getting-Started">get started with Rach5</a>! The full details are available at the wiki.
View
0  wp-content/themes/themename/comments.php → comments.php
File renamed without changes
View
4 wp-content/themes/themename/config.rb → config.rb
@@ -25,8 +25,8 @@
# relative_assets = true
# Connection Details
-sftp_host = 'website.tld'
-sftp_user = 'username'
+sftp_host = ''
+sftp_user = ''
# Upload
on_stylesheet_saved do |filename|
View
2  wp-content/themes/themename/footer.php → footer.php
@@ -1,6 +1,6 @@
<footer>
<div id="legal">
- <?php copyright('2011'); ?> <?php bloginfo('name'); ?>
+ <?php copyright('2011'); ?> <?php bloginfo('name'); ?>
</div>
</footer>
View
0  ...ontent/themes/themename/sass/includes/_fonts.scss → frontpage.php
File renamed without changes
View
32 functions.php
@@ -0,0 +1,32 @@
+<?php
+
+if ( !function_exists('rach5_info') ) {
+ function no_rach5() {
+ echo '<div class="error">';
+ echo '<p>', sprintf(__('You need to <a href="%s">install the Rach5 plugin</a>.', 'rach5'), admin_url('plugin-install.php?tab=upload') ), '</p>';
+ echo '</div>';
+ }
+ add_action('admin_notices', 'no_rach5');
+}
+
+/*
+ *
+ * Website.tld custom functions
+ *
+ */
+
+function rach5_setup() {
+ // Editor style
+ add_theme_support('editor_style');
+ add_editor_style('css/editor-style.css?' . time());
+
+ // add_theme_support('post-thumbnails');
+
+ // update_option('upload_path', 'assets');
+}
+add_action('after_setup_theme', 'rach5_setup');
+
+// Content width
+if ( !isset( $content_width ) ) {
+ $content_width = 500;
+}
View
11 wp-content/themes/themename/head.php → head.php
@@ -9,7 +9,7 @@
// Global Stylesheet
stylesheet_link_tag('/global.css', true, 0, true);
-
+
// Formalize
stylesheet_link_tag('http://cdn.vanpattenmedia.com/js/libs/formalize/1.2/css/formalize.css', false, 1, false); ?>
@@ -22,11 +22,11 @@
<![endif]-->
<?php /* JavaScript */
- ?><script type="text/javascript" src="http://cdn.vanpattenmedia.com/js/libs/labjs/2.0.3/LAB.min.js"></script>
+ ?><script type="text/javascript" src="//cdn.vanpattenmedia.com/js/libs/labjs/2.0.3/LAB.min.js"></script>
<script type="text/javascript">
$LAB
- .script('http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js').wait()
- .script('http://cdn.vanpattenmedia.com/js/libs/formalize/1.2/js/jquery.formalize.min.js').wait()
+ .script('//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js').wait()
+ .script('//cdn.vanpattenmedia.com/js/libs/formalize/1.2/js/jquery.formalize.min.js').wait()
.script('<?php bloginfo('template_directory'); ?>/js/script.js').wait();
</script>
@@ -40,8 +40,7 @@
<script type="text/javascript">
var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-575101-19']);
- _gaq.push(['_setDomainName', 'vanpattenmedia.com']);
+ _gaq.push(['_setAccount', 'UA-XXXXXX-XX']);
_gaq.push(['_trackPageview']);
(function() {
View
3  header.php
@@ -0,0 +1,3 @@
+ <header>
+ <h1><a id="logo" href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a></h1>
+ </header>
View
6 humans.txt
@@ -1,6 +0,0 @@
-/* TEAM */
-Designer: Chris Van Patten
-Contact: chris [at] vanpattenmedia.com
-Twitter: @chrisvanpatten
-Twitter: @vanpattenmedia
-From: Upstate New York
View
0  wp-content/themes/themename/img/opengraph.png → img/opengraph.png
File renamed without changes
View
12 wp-content/themes/themename/index.php → index.php
@@ -9,7 +9,17 @@
<?php get_header(); ?>
<section id="content">
- <?php get_template_part('loop', 'post'); ?>
+ <?php
+
+ if ( is_front_page() ) {
+ get_template_part('frontpage');
+ } elseif ( is_page() ) {
+ get_template_part('loop', 'page');
+ } else {
+ get_template_part('loop', 'post');
+ }
+
+ ?>
</section>
<?php get_footer(); ?>
View
0  wp-content/themes/themename/js/script.js → js/script.js
File renamed without changes
View
0  wp-content/themes/themename/loop-page.php → loop-page.php
File renamed without changes
View
6 wp-content/themes/themename/loop-post.php → loop-post.php
@@ -1,5 +1,5 @@
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<p>Posted at <time class="updated" datetime="<?php the_modified_time('c'); ?>" pubdate><?php the_time(); ?> on <?php the_time(get_option('date_format')); ?></time></p>
@@ -10,8 +10,8 @@
</div>
</article><?php endwhile; ?>
- <section class="posts-nav">
- <?php if (is_single()) {
+ <section class="posts-nav clearfix">
+ <?php if (!is_single()) {
echo '<div class="prev-posts">'; next_posts_link( '&laquo; Older Posts' ); echo '</div>';
echo '<div class="next-posts">'; previous_posts_link( 'Newer Posts &raquo;' ); echo '</div>';
} else {
View
6 robots.txt
@@ -1,6 +0,0 @@
-# Sensible defaults
-
-User-agent: *
-Disallow: /wp-admin
-Disallow: /wp-includes
-Disallow: /xmlrpc.php
View
4 wp-content/themes/themename/sass/editor-style.scss → sass/editor-style.scss
@@ -1,5 +1,5 @@
// Fonts
-@import "includes/fonts";
+// @import "includes/fonts";
// Rach5 imports
@import "includes/rach5/definitions";
@@ -11,4 +11,4 @@
@import "compass/typography";
// Your imports
-// @import "includes/definitions";
+@import "includes/definitions";
View
34 sass/global.scss
@@ -0,0 +1,34 @@
+// Fonts
+// @import "includes/fonts";
+
+// Rach5 imports
+@import "includes/rach5/definitions";
+@import "includes/rach5/fixes";
+
+// Compass imports
+@import "rgbapng";
+@import "compass/css3";
+@import "compass/typography";
+
+// Your imports
+@import "includes/definitions";
+
+/*
+ *
+ * HERE BE DRAGONS...
+ *
+ */
+
+body {
+
+}
+
+
+/*
+ *
+ * Media Queries should always be loaded *last*
+ * for the good of the cascade.
+ *
+ */
+
+@import "includes/media-queries";
View
0  wp-content/themes/themename/css/global.css → sass/includes/_definitions.scss
File renamed without changes
View
0  wp-content/themes/themename/css/editor-style.css → sass/includes/_fonts.scss
File renamed without changes
View
0  ...hemes/themename/sass/includes/_media-queries.scss → sass/includes/_media-queries.scss
File renamed without changes
View
0  ...s/themename/sass/includes/rach5/_definitions.scss → sass/includes/rach5/_definitions.scss
File renamed without changes
View
0  .../themes/themename/sass/includes/rach5/_fixes.scss → sass/includes/rach5/_fixes.scss
File renamed without changes
View
9 style.css
@@ -0,0 +1,9 @@
+/*
+Theme Name:
+Theme URI:
+Description:
+Author:
+Author URI:
+Version:
+Tags: custom rach5
+*/
View
100 wp-content/maintenance.php
@@ -1,100 +0,0 @@
-<?php
-$protocol = $_SERVER["SERVER_PROTOCOL"];
-if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
- $protocol = 'HTTP/1.0';
-header( "$protocol 503 Service Unavailable", true, 503 );
-header( 'Content-Type: text/html; charset=utf-8' );
-
-// Redefining the bloginfo function, for forward compatibility
-function bloginfo($name) {
- // Name your site
- echo 'Website Name';
-}
-?>
-<!DOCTYPE HTML>
-<html lang="en-US">
- <head>
- <meta charset="UTF-8">
- <title><?php bloginfo('name'); ?> Coming Soon</title>
- <link rel="stylesheet" type="text/css" href="http://cdn.vanpattenmedia.com/css/style.css" media="all" />
- <link rel="stylesheet" href="http://cdn.vanpattenmedia.com/js/libs/formalize/css/formalize.css" />
- <script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-XXXXXX-XX']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
-
- </script>
- </head>
- <body>
- <div id="wrap">
- <div id="top">
- <h1><?php bloginfo('name'); ?></h1>
- <h2>Coming soon...</h2>
- </div>
- <!-- <form name="waiting_list" id="waiting_list" method="post" action="<?php bloginfo('template_directory'); ?>/action.php">
- <label for="email">Get an email when this website launches...</label>
- <div id="form">
- <input type="text" id="email" name="email" placeholder="email@address.com" />
- <input type="submit" value="Submit" id="submit" />
- </div>
- <div id="done">Thanks! We'll email you when the site is live.</div>
- </form> -->
- <h4 id="by"><a href="http://www.vanpattenmedia.com/">website by <span>Van Patten Media</span></a></h4>
- </div>
-
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
-
- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" type="text/javascript"></script>
-
- <script src="http://cdn.vanpattenmedia.com/js/libs/formalize/js/jquery.formalize.min.js"></script>
- <script src="http://cdn.vanpattenmedia.com/js/libs/jquery.placeholder.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('#submit').click(function () {
- var email = $('#email');
- var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
-
- if (email.val() == '') {
- $('label').html("Oops, you forgot to enter your email address.").css('color','red');
- $('form').effect('shake', {times: 4, distance: 7}, 50);
- return false;
- } else if (!emailReg.test(email.val())) {
- $('label').html("That doesn't look like a real email address.").css('color','red');
- $('form').effect('shake', {times: 4, distance: 7}, 50);
- return false;
- }
-
- var data = 'email=' + email.val();
-
- $('#email').attr('disabled','true');
- $('#submit').attr('disabled','true');
- $('.loading').show();
-
- $.ajax({
- url: "action.php",
- type: "GET",
- data: data,
- cache: false,
- success: function (html) {
- if (html==1) {
- $('#email').attr('disabled','true');
- $('#submit').attr('disabled','true');
- $('label').html('');
- $('#done').fadeIn('slow');
- } else alert('Sorry, unexpected error. Please try again later.');
- }
- });
- return false;
- });
- });
- </script>
- </body>
-</html>
-<?php die(); ?>
View
15 wp-content/themes/themename/front-page.php
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
-<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
-<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
-<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
-<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
-<?php get_template_part('head'); ?>
-<body <?php body_class(); ?>>
-<?php get_header(); ?>
-
- <!-- Your stuff here -->
-
-<?php get_footer(); ?>
-</body>
-</html>
View
40 wp-content/themes/themename/functions.php
@@ -1,40 +0,0 @@
-<?php
-
-if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
-
-// Include Rach5 functions: this is the least you need to run Rach5
-require_once locate_template('/inc/rach5-functions.php');
-
-define('WP_BASE', wp_base_dir());
-define('THEME_NAME', next(explode('/themes/', get_template_directory())));
-define('RELATIVE_PLUGIN_PATH', str_replace(site_url() . '/', '', plugins_url()));
-define('FULL_RELATIVE_PLUGIN_PATH', WP_BASE . '/' . RELATIVE_PLUGIN_PATH);
-define('RELATIVE_CONTENT_PATH', str_replace(site_url() . '/', '', content_url()));
-define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);
-
-require_once locate_template('/inc/rach5-admin.php');
-require_once locate_template('/inc/rach5-clean.php');
-require_once locate_template('/inc/rach5-htaccess.php');
-require_once locate_template('/inc/rach5-html5.php');
-
-// ------------------------------------------------------------ //
-//
-// Website.tld custom functions
-//
-// ------------------------------------------------------------ //
-
-function rach5_setup() {
- // Editor style
- add_theme_support('editor_style');
- add_editor_style('css/editor-style.css?' . time());
-
- // add_theme_support('post-thumbnails');
-
- // update_option('upload_path', 'assets');
-}
-add_action('after_setup_theme', 'rach5_setup');
-
-// Content width
-if ( ! isset( $content_width ) ) {
- $content_width = 500;
-}
View
5 wp-content/themes/themename/header.php
@@ -1,5 +0,0 @@
- <header>
- <a id="logo" href="<?php echo home_url(); ?>/">
- <img src="http://placehold.it/300x75" width="300" height="75" alt="<?php bloginfo('name'); ?>">
- </a>
- </header>
View
48 wp-content/themes/themename/inc/rach5-admin.php
@@ -1,48 +0,0 @@
-<?php
-
-// ------------------------------------------------------------ //
-//
-// Rach5
-// http://labs.vanpattenmedia.com/projects/rach5/
-//
-// Functions: Customize wp-admin
-//
-// ------------------------------------------------------------ //
-
-// Disable admin bar
-add_filter( 'show_admin_bar', '__return_false' );
-
-// Hide TinyMCE status bar
-function rach5_tinymce( $config ) {
- $config['theme_advanced_statusbar_location'] = none;
- return $config;
-}
-add_filter('tiny_mce_before_init', 'rach5_tinymce');
-
-// Disable online plugin and theme edits
-define('DISALLOW_FILE_EDIT',true);
-
-// Remind you to change the "Just another WordPress site" tagline
-function rach5_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(__('Don\'t forget to change the <a href="%s">site tagline</a>. <a href="%s" style="float: right;">Ignore</a>', 'rach5'), admin_url('options-general.php'), '?tagline_notice_ignore=0'), '</p>';
- echo '</div>';
- }
-}
-
-if ((get_option('blogdescription') === 'Just another WordPress site') && isset($_GET['page']) != 'theme_activation_options') {
- add_action('admin_notices', 'rach5_notice_tagline');
-}
-
-function rach5_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);
- }
-}
-add_action('admin_init', 'rach5_notice_tagline_ignore');
View
142 wp-content/themes/themename/inc/rach5-clean.php
@@ -1,142 +0,0 @@
-<?php
-
-// ------------------------------------------------------------ //
-//
-// Rach5
-// http://labs.vanpattenmedia.com/projects/rach5/
-//
-// Functions: Clean the source code
-//
-// ------------------------------------------------------------ //
-
-// Remove spaces from wp_title without defined separator
-function rach5_title_despacer($title) {
- return trim($title);
-}
-add_filter('wp_title', 'rach5_title_despacer');
-
-// Fix homepage body class
-function strip_page_from_body_class($classes, $class) {
- global $post;
- if ( !is_front_page() ){
- return $classes;
- } else {
- foreach ($classes as &$str) {
- if (strpos($str, "page") > -1) {
- $str = "";
- }
- }
- }
- return $classes;
-}
-add_filter("body_class", "strip_page_from_body_class", 10, 2);
-
-// remove WordPress version from RSS feeds
-function rach5_disable_version() {
- return '';
-}
-add_filter('the_generator','rach5_disable_version');
-
-
-// ------------------------------------------------------------ //
-//
-// Root relative URLs
-// Inspired by http://bit.ly/a35LmX
-//
-// ------------------------------------------------------------ //
-
-function rach5_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;
-}
-
-if (!is_admin() && !in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'))) {
- $tags = array(
- 'bloginfo_url',
- 'theme_root_uri',
- 'stylesheet_directory_uri',
- 'template_directory_uri',
- 'script_loader_src',
- 'style_loader_src',
- 'plugins_url',
- 'the_permalink',
- 'wp_list_pages',
- 'wp_list_categories',
- 'wp_nav_menu',
- 'the_content_more_link',
- 'the_tags',
- 'get_pagenum_link',
- 'get_comment_link',
- 'month_link',
- 'day_link',
- 'year_link',
- 'tag_link',
- 'the_author_posts_link'
- );
- add_filters($tags, 'rach5_root_relative_url');
-}
-
-function rach5_root_relative_attachment_urls() {
- if (!is_feed()) {
- add_filter('wp_get_attachment_url', 'rach5_root_relative_url');
- add_filter('wp_get_attachment_link', 'rach5_root_relative_url');
- }
-}
-add_action('pre_get_posts', 'rach5_root_relative_attachment_urls');
-
-
-// ------------------------------------------------------------ //
-//
-// Clean up the head
-//
-// ------------------------------------------------------------ //
-
-function rach5_rel_canonical() {
- if (!is_singular()) {
- return;
- }
-
- global $wp_the_query;
- if (!$id = $wp_the_query->get_queried_object_id()) {
- return;
- }
-
- $link = get_permalink($id);
- echo "<link rel=\"canonical\" href=\"$link\">\n";
-}
-
-function rach5_head_cleanup() {
- remove_action('wp_head', 'wlwmanifest_link');
- remove_action('wp_head', 'rsd_link');
- remove_action('wp_head', 'wp_generator');
- remove_action('wp_head', 'feed_links_extra', 3);
- 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_shortlink_wp_head', 10, 0);
- remove_action('wp_head', 'noindex', 1);
- // remove_action('wp_head', 'feed_links', 2);
-
- remove_action('wp_head', 'rel_canonical');
- add_action('wp_head', 'rach5_rel_canonical');
-
- if (!is_admin()) {
- wp_deregister_script('l10n');
- wp_deregister_script('jquery');
- wp_register_script('jquery', '', '', '', true);
- }
-}
-add_action('init', 'rach5_head_cleanup');
View
95 wp-content/themes/themename/inc/rach5-functions.php
@@ -1,95 +0,0 @@
-<?php
-
-// ------------------------------------------------------------ //
-//
-// Rach5
-// http://labs.vanpattenmedia.com/projects/rach5/
-//
-// Functions: Master functions
-//
-// ------------------------------------------------------------ //
-
-// "stylesheet_link_tag," borrowed from Roots, inspired by Rails
-//
-// Options:
-// $file = Location of file
-// $local = Local or remote file? (e.g. include get_template_directory_uri() or not)
-// $tabs = Number of tabs to proceed the line
-// $newline = Add a newline after?
-// $rel = "stylesheet" by default, but you can change it if you want
-function stylesheet_link_tag($file, $local = true, $tabs = 0, $newline = true, $rel = 'stylesheet') {
- $indent = str_repeat("\t", $tabs);
- echo $indent . '<link rel="' . $rel .'" href="' . ($local ? get_template_directory_uri() . '/css' : '') . $file . '">' . ($newline ? "\n" : "");
-}
-
-// returns WordPress subdirectory if applicable
-function wp_base_dir() {
- preg_match('!(https?://[^/|"]+)([^"]+)?!', site_url(), $matches);
- if (count($matches) === 3) {
- return end($matches);
- } else {
- return '';
- }
-}
-
-// opposite of built in WP functions for trailing slashes
-function leadingslashit($string) {
- return '/' . unleadingslashit($string);
-}
-
-function unleadingslashit($string) {
- return ltrim($string, '/');
-}
-
-function add_filters($tags, $function) {
- foreach($tags as $tag) {
- add_filter($tag, $function);
- }
-}
-
-// What year should the copyright start?
-function copyright($copystart) {
- echo 'Copyright &copy; ' . $copystart;
-
- if ( date('Y') > $copystart ) {
- echo '-' . date('Y');
- }
-}
-
-// A nice tab function, if you like clean source like me.
-function tab($count=1){
- for($x = 1; $x <= $count; $x++){
- $output .= "\t";
- }
- return $output;
-}
-
-// Friendlier excerpt
-function new_excerpt_more($more) {
- return '... <a href="'. get_permalink($post->ID) . '">Read more...</a>';
-}
-add_filter('excerpt_more', 'new_excerpt_more');
-
-// Custom get_the_excerpt function
-function rach5_get_the_excerpt() {
- global $posts;
-
- if ( empty($posts[0]->post_excerpt) ) {
- // 1. Get the initial data for the excerpt
- $content = $posts[0]->post_content;
-
- // 2. Strip tags from $content
- $stripped_content = strip_tags($content);
-
- // 3. Trim words from $content
- $trimmed_content = wp_trim_words($stripped_content, 20);
-
- // 4. Here's your excerpt!
- $rach5_excerpt = str_replace("\n", ' ', $trimmed_content);
- } else {
- // When the post excerpt has been set explicitly, then it has priority.
- $rach5_excerpt = $posts[0]->post_excerpt;
- }
-
- return $rach5_excerpt;
-}
View
57 wp-content/themes/themename/inc/rach5-htaccess.php
@@ -1,57 +0,0 @@
-<?php
-
-// ------------------------------------------------------------ //
-//
-// Rach5
-// http://labs.vanpattenmedia.com/projects/rach5/
-//
-// Functions: .htaccess rewrites
-//
-// ------------------------------------------------------------ //
-
-// Verify writable .htaccess file
-function rach5_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. ', 'rach5'), admin_url('options-permalink.php')) . "</p></div>';"));
- }
- }
-}
-add_action('admin_init', 'rach5_htaccess_writable');
-
-// Ditch /wp-content/themes/themename/ and /wp-content/plugins/
-function rach5_add_rewrites($content) {
- global $wp_rewrite;
- $rach5_new_non_wp_rules = array(
- 'css/(.*)' => THEME_PATH . '/css/$1',
- 'js/(.*)' => THEME_PATH . '/js/$1',
- 'img/(.*)' => THEME_PATH . '/img/$1',
- 'plugins/(.*)' => RELATIVE_PLUGIN_PATH . '/$1'
- );
- $wp_rewrite->non_wp_rules = $rach5_new_non_wp_rules;
- return $content;
-}
-
-function rach5_clean_urls($content) {
- if (strpos($content, FULL_RELATIVE_PLUGIN_PATH) === 0) {
- return str_replace(FULL_RELATIVE_PLUGIN_PATH, WP_BASE . '/plugins', $content);
- } else {
- return str_replace('/' . THEME_PATH, '', $content);
- }
-}
-
-// Only use clean URLs if the theme isn't a child or a multisite install
-if (!is_multisite() && !is_child_theme()) {
- add_action('generate_rewrite_rules', 'rach5_add_rewrites');
- if (!is_admin()) {
- $tags = array(
- 'plugins_url',
- 'bloginfo',
- 'stylesheet_directory_uri',
- 'template_directory_uri',
- 'script_loader_src',
- 'style_loader_src'
- );
- add_filters($tags, 'rach5_clean_urls');
- }
-}
View
47 wp-content/themes/themename/inc/rach5-html5.php
@@ -1,47 +0,0 @@
-<?php
-
-// ------------------------------------------------------------ //
-//
-// Rach5
-// http://labs.vanpattenmedia.com/projects/rach5/
-//
-// Functions: HTML5 support
-//
-// ------------------------------------------------------------ //
-
-// Remove self-closing <img> and <input> tags
-function rach5_remove_self_closing_tags($input) {
- return str_replace(' />', '>', $input);
-}
-add_filter('get_avatar', 'rach5_remove_self_closing_tags');
-add_filter('comment_id_fields', 'rach5_remove_self_closing_tags');
-add_filter('post_thumbnail_html', 'rach5_remove_self_closing_tags');
-
-function rach5_remove_self_closing_tags_2( $content ) {
- return str_replace( ' />', '>', $content );
-}
-add_filter( 'the_content', 'rach5_remove_self_closing_tags_2', 25 );
-
-// HTML5 compatible image caption
-function rach5_img_caption_shortcode($val, $attr, $content = null) {
- extract(shortcode_atts(array(
- 'id' => '',
- 'align' => '',
- 'width' => '',
- 'caption' => ''
- ), $attr));
-
- if ( 1 > (int) $width || empty($caption) )
- return $val;
-
- $capid = '';
- if ( $id ) {
- $id = esc_attr($id);
- $capid = 'id="figcaption_'. $id . '" ';
- $id = 'id="' . $id . '" ';
- }
-
- return '<figure ' . $id . 'class="wp-caption ' . esc_attr($align) . '">' . do_shortcode( $content ) . '<figcaption ' . $capid
- . 'class="wp-caption-text">' . $caption . '</figcaption></figure>';
-}
-add_filter('img_caption_shortcode', 'rach5_img_caption_shortcode',10,3);
View
17 wp-content/themes/themename/page.php
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
-<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
-<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
-<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
-<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
-<?php get_template_part('head'); ?>
-<body <?php body_class(); ?>>
-<?php get_header(); ?>
-
- <section id="content">
- <?php get_template_part('loop', 'page'); ?>
- </section>
-
-<?php get_footer(); ?>
-</body>
-</html>
View
32 wp-content/themes/themename/sass/global.scss
@@ -1,32 +0,0 @@
-// Fonts
-@import "includes/fonts";
-
-// Rach5 imports
-@import "includes/rach5/definitions";
-@import "includes/rach5/fixes";
-
-// Compass imports
-@import "rgbapng";
-@import "compass/css3";
-@import "compass/typography";
-
-// Your imports
-// @import "includes/definitions";
-
-// ------------------------------------------------------------ //
-//
-// HERE BE DRAGONS...
-//
-// ------------------------------------------------------------ //
-
-
-
-
-// ------------------------------------------------------------ //
-//
-// Media Queries should always be included *last*
-// for the good of the cascade.
-//
-// ------------------------------------------------------------ //
-
-@import "includes/media-queries";
View
17 wp-content/themes/themename/single.php
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
-<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
-<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
-<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
-<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
-<?php get_template_part('head'); ?>
-<body <?php body_class(); ?>>
-<?php get_header(); ?>
-
- <section id="content">
- <?php get_template_part('loop', 'post'); ?>
- </section>
-
-<?php get_footer(); ?>
-</body>
-</html>
View
9 wp-content/themes/themename/style.css
@@ -1,9 +0,0 @@
-/*
-Theme Name:
-Theme URI:
-Description:
-Author: Chris Van Patten
-Author URI: http://www.vanpattenmedia.com/
-Version: 0.1
-Tags: vanpattenmedia custom
-*/
Please sign in to comment.
Something went wrong with that request. Please try again.