summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore13
-rw-r--r--content-single.php85
-rw-r--r--functions.php121
-rw-r--r--header.php.patch22
-rw-r--r--index.php.patch11
-rw-r--r--screenshot.pngbin0 -> 38565 bytes
-rw-r--r--sidebar-index.php7
-rw-r--r--single.php.patch23
-rw-r--r--style.scss155
-rw-r--r--theme.mk13
10 files changed, 449 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 5037b57..e2cab0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,18 @@
+# DO NOT EDIT, this file is automatically made by `Makefile'
+#
# ignore everyting
*
# but these:
-!license.txt
+!style.scss
+!functions.php
+!screenshot.png
+!index.php.patch
+!header.php.patch
+!single.php.patch
+!content-single.php
+!sidebar-index.php
!twentyeleven-fix.scss
+!license.txt
!.gitignore
+!theme.mk
!Makefile
diff --git a/content-single.php b/content-single.php
new file mode 100644
index 0000000..987e123
--- /dev/null
+++ b/content-single.php
@@ -0,0 +1,85 @@
+<?php
+/**
+ * The template for displaying content in the single.php template
+ *
+ * @package WordPres
+ * @subpackage Twenty_Eleven
+ * @since Twenty Eleven 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <?php
+ if (
+ is_singular()
+ && has_post_thumbnail( $post->ID )
+ && ($image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) )
+ ){
+ // Houston, we have a new header image!
+ echo '<figure>';
+ echo get_the_post_thumbnail( $post->ID , null);
+ echo '<figcaption>';
+ echo get_post(get_post_thumbnail_id( $post->ID ))->post_excerpt;
+ echo '</figcaption>';
+ echo '</figure>';
+ }
+ ?>
+ <h1 class="entry-title"><?php the_title(); ?></h1>
+ <?php
+ if ( 'post' == get_post_type() ) : ?>
+ <div class="entry-meta">
+ <?php twentyeleven_posted_on(); ?>
+ </div><!-- .entry-meta -->
+ <?php endif; ?>
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+
+ <footer class="entry-meta">
+ <?php
+ /* translators: used between list items, there is a space after the comma */
+ $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
+
+ /* translators: used between list items, there is a space after the comma */
+ $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
+ if ( '' != $tag_list ) {
+ $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by %5$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
+ } elseif ( '' != $categories_list ) {
+ $utility_text = __( 'This entry was posted in %1$s by %5$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
+ } else {
+ $utility_text = __( 'This entry was posted by %5$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
+ }
+
+ printf(
+ $utility_text,
+ $categories_list,
+ $tag_list,
+ esc_url( get_permalink() ),
+ the_title_attribute( 'echo=0' ),
+ lnns_authors()
+ );
+ ?>
+ <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
+
+ <?php if ( get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
+ <div id="author-info">
+ <div id="author-avatar">
+ <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?>
+ </div><!-- #author-avatar -->
+ <div id="author-description">
+ <h2><?php printf( esc_attr__( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
+ <?php the_author_meta( 'description' ); ?>
+ <div id="author-link">
+ <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
+ <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyeleven' ), get_the_author() ); ?>
+ </a>
+ </div><!-- #author-link -->
+ </div><!-- #author-description -->
+ </div><!-- #entry-author-info -->
+ <?php endif; ?>
+ </footer><!-- .entry-meta -->
+</article><!-- #post-<?php the_ID(); ?> -->
diff --git a/functions.php b/functions.php
new file mode 100644
index 0000000..ecb0644
--- /dev/null
+++ b/functions.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ * @author Luke Shumaker
+ * @author Chris Aprea
+ */
+
+/**
+ * In child themes the functions.php is applied before the parent
+ * theme's functions.php. So we need to wait for the parent theme to add
+ * it's filter before we can remove it.
+ */
+function lnns_child_theme_setup() {
+ // Removes the filter that adds the "singular" class to the body element
+ // which centers the content and does not allow for a sidebar
+ remove_filter( 'body_class', 'twentyeleven_body_classes' );
+}
+add_action( 'after_setup_theme', 'lnns_child_theme_setup' );
+
+function lnns_widgets_init() {
+ register_sidebar( array(
+ 'name' => __('Index Header', 'northstar-twentyeleven'),
+ 'id' => 'index-page-widgetarea',
+ 'description' => __( 'An optional widget area at the top of the index page', 'northstar-twentyeleven'),
+ 'before_widget' => '<div id="%1$s" class="widget %$s">',
+ 'after_widget' => '</div>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+}
+add_action( 'widgets_init', 'lnns_widgets_init' );
+
+function lnns_authors_loop($callback) {
+ $loop = false;
+ $authors = null;
+
+ if (function_exists('coauthors')) {
+ $loop = true;
+ $authors = new CoAuthorsIterator();
+ @$authors->iterate();
+ }
+
+ $authors_data = array();
+ do {
+ $callback(&$authors_data);
+ } while ($loop && $authors->iterate());
+
+ return $authors_data;
+}
+
+function _lnns_authors(&$strings) {
+ $tran = 'northstar-twentyeleven';
+
+ $url = get_author_posts_url(get_the_author_meta('ID'));
+ $name = get_the_author();
+
+ $strings[] = sprintf('<a href="%1$s">%2$s</a>',
+ esc_url($url),
+ $name);
+}
+function lnns_authors() {
+ $strings = lnns_authors_loop('_lnns_authors');
+ return implode(__(' and '), $strings);
+}
+
+/**
+ * Prints HTML with meta information for the current post-date/time and author.
+ * If CoAuthors is set up, will loop through all authors.
+ */
+function _twentyeleven_posted_on(&$authors_data) {
+ $id = get_the_author_meta('ID');
+
+ $author_data = array();
+ $author_data['url'] = get_author_posts_url($id);
+ $author_data['name'] = get_the_author();
+
+ $user = new WP_User($id);
+ $roles = array();
+ if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
+ foreach ( $user->roles as $role ) {
+ $roles[] = str_replace('_', ' ', $role);
+ }
+ }
+ $author_data['roles'] = $roles;
+
+ $authors_data[] = $author_data;
+}
+function twentyeleven_posted_on() {
+ $tran = 'northstar-twentyeleven';
+ $authors_data = lnns_authors_loop('_twentyeleven_posted_on');
+ // Now print it all //////////////////////////////////////////
+
+ $format = __('<span class="author vcard">'.
+ '<a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a>'.
+ ' <span class="role">%4$s</span>'.
+ '</span>', $tran);
+
+ $authors = array();
+ foreach ($authors_data as $author) {
+ $authors[] = sprintf($format,
+ esc_url($author['url']),
+ sprintf(esc_attr__('View all posts by %s', $tran),
+ $author['name'] ),
+ esc_html($author['name']),
+ esc_html(implode(' ', $author['roles']))
+ );
+ }
+ $authors_string = implode( __('<span class="sep"> and </span>', $tran),
+ $authors);
+ printf( __('<span class="authors">%s</span>', $tran), $authors_string);
+
+ // Print the date.
+ printf( __(' <span class="entry-date"><span class="sep">Published on </span>'.
+ '<a href="%1$s" title="%2$s" rel="bookmark">'.
+ '<time class="entry-date" datetime="%3$s" pubdate>%4$s</time>'.
+ '</a></span>', $tran),
+ esc_url( get_permalink() ),
+ esc_attr( get_the_time() ),
+ esc_attr( get_the_date( 'c' ) ),
+ esc_html( get_the_date() )
+ );
+}
diff --git a/header.php.patch b/header.php.patch
new file mode 100644
index 0000000..d2552b8
--- /dev/null
+++ b/header.php.patch
@@ -0,0 +1,22 @@
+--- ../twentyeleven/header.php 2011-09-29 13:42:35.000000000 -0400
++++ header.php 2011-09-29 15:52:58.000000000 -0400
+@@ -81,18 +81,7 @@
+ if ( ! empty( $header_image ) ) :
+ ?>
+ <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
+- <?php
+- // The header image
+- // Check if this is a post or page, if it has a thumbnail, and if it's a big one
+- if ( is_singular() &&
+- has_post_thumbnail( $post->ID ) &&
+- ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) &&
+- $image[1] >= HEADER_IMAGE_WIDTH ) :
+- // Houston, we have a new header image!
+- echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
+- else : ?>
+- <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
+- <?php endif; // end check for featured image or standard header ?>
++ <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
+ </a>
+ <?php endif; // end check for removed header image ?>
+
diff --git a/index.php.patch b/index.php.patch
new file mode 100644
index 0000000..d7ee177
--- /dev/null
+++ b/index.php.patch
@@ -0,0 +1,11 @@
+--- ../twentyeleven/index.php 2011-09-29 13:43:12.000000000 -0400
++++ index.php 2011-09-29 15:56:54.000000000 -0400
+@@ -17,6 +17,8 @@
+ <div id="primary">
+ <div id="content" role="main">
+
++ <?php get_sidebar( 'index' ); ?>
++
+ <?php if ( have_posts() ) : ?>
+
+ <?php twentyeleven_content_nav( 'nav-above' ); ?>
diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000..9664bf4
--- /dev/null
+++ b/screenshot.png
Binary files differ
diff --git a/sidebar-index.php b/sidebar-index.php
new file mode 100644
index 0000000..75558a7
--- /dev/null
+++ b/sidebar-index.php
@@ -0,0 +1,7 @@
+<?php
+if (!is_active_sidebar( 'index-page-widgetarea' ))
+ return;
+?>
+<div id="index-widget">
+ <?php dynamic_sidebar( 'sidebar-4' ); ?>
+</div>
diff --git a/single.php.patch b/single.php.patch
new file mode 100644
index 0000000..97a9e00
--- /dev/null
+++ b/single.php.patch
@@ -0,0 +1,23 @@
+--- ../twentyeleven/single.php 2011-09-29 13:43:25.000000000 -0400
++++ single.php 2011-09-29 16:23:02.000000000 -0400
+@@ -14,11 +14,12 @@
+
+ <?php while ( have_posts() ) : the_post(); ?>
+
++ <!-- Remove the "Previous" and "Next" links, uncomment if you'd like these
+ <nav id="nav-single">
+ <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
+ <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">&larr;</span> Previous', 'twentyeleven' ) ); ?></span>
+ <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></span>
+- </nav><!-- #nav-single -->
++ </nav> --> <!-- #nav-single -->
+
+ <?php get_template_part( 'content', 'single' ); ?>
+
+@@ -29,4 +30,5 @@
+ </div><!-- #content -->
+ </div><!-- #primary -->
+
++<?php get_sidebar(); ?>
+ <?php get_footer(); ?>
+\ No newline at end of file
diff --git a/style.scss b/style.scss
new file mode 100644
index 0000000..e00eccf
--- /dev/null
+++ b/style.scss
@@ -0,0 +1,155 @@
+/*
+Theme Name: North Star - Twenty Eleven
+Theme URI: http://lnnorthstar.org
+
+Author: Luke Shumaker, based on work by the WordPress team and Chris Aprea
+Author URI: http://lukeshu.ath.cx
+
+License: GNU General Public License
+License URI: license.txt
+
+Description: The North Star 2011-2012 theme, a child of Twenty Eleven
+Version: 0.1
+Tags: multi-author, significant-rolls
+
+Template: twentyeleven
+*/
+
+@import url('../twentyeleven/style.css');
+@import "twentyeleven-fix.scss";
+
+/* Document-structure-y things */
+
+
+#page {
+ background: transparent;
+ #access {
+ margin: 0 auto;
+ box-shadow: none;
+ }
+ #main {
+ padding: 0;
+ #primary {
+ margin: 0;
+ width: 70%;
+ #content {
+ margin: 0 0 1.5em 0;
+ width: 100%;
+ }
+ }
+ #secondary {
+ margin: 0;
+ width: 28%;
+ }
+ .post, #content nav, aside.widget {
+ background: white;
+ padding: 1.5em;
+ }
+ .post {
+ padding-top: 0;
+ padding-bottom: 0;
+ }
+ }
+}
+
+.entry-header {
+ font-size: .8em;
+ figure {
+ margin: 0;
+ img {
+ width: 100%;
+ height: auto;
+ }
+ figcaption {
+ strong {
+ text-transform: uppercase;
+ }
+ cite {
+ float: right;
+ width: 100%;
+ text-align: right;
+ text-transform: lowercase;
+ }
+ .alignleft,
+ .alignright {
+ /* These are obsolete, but I keep them around
+ * because some old captions have them hardcoded
+ * in, and I don't want to change them. */
+ width: 45%;
+ margin-bottom: 1.5em;
+ }
+ }
+ }
+ .entry-meta {
+ .authors {
+ display: block;
+ float: left;
+ & > * {
+ float: left;
+ margin-right: 0.5em;
+ }
+ .vcard {
+ * {
+ display: block;
+ }
+ .role {
+ text-transform: uppercase;
+ }
+ }
+ }
+ span.entry-date {
+ display: block;
+ float: right;
+ }
+ }
+}
+
+.entry-content,
+.entry-summary {
+ clear: both;
+}
+
+/* Generic things */
+
+blockquote {
+ &:before,
+ &:after {
+ color: #740000;
+ display: block;
+ line-height: 1em;
+ font-size: 4em;
+ }
+ &:before {
+ content: "“";
+ height: 0;
+ margin-left: -1em;
+ }
+ &:after {
+ content: "”";
+ margin-left: 100%;
+ margin-top: -1.25em;
+ margin-bottom: 1.25em;
+ }
+ p {
+ margin-bottom: 0.5em;
+ }
+ footer {
+ text-align: right;
+ margin-bottom: 2em;
+ }
+}
+
+dd {
+ margin-bottom: auto;
+ margin-left: 4em;
+}
+
+/* Specific things */
+
+.widget_statusnetwidget {
+ background: #CCCCBB;
+ h3 {
+ background: url('https://si0.twimg.com/images/dev/cms/intents/bird/bird_blue/bird_16_blue.png') no-repeat left center;
+ padding-left: 24px;
+ }
+}
diff --git a/theme.mk b/theme.mk
new file mode 100644
index 0000000..7e39d8d
--- /dev/null
+++ b/theme.mk
@@ -0,0 +1,13 @@
+srcfiles = \
+ style.scss \
+ functions.php \
+ screenshot.png \
+ index.php.patch \
+ header.php.patch \
+ single.php.patch \
+ content-single.php \
+ sidebar-index.php
+
+targets = style.css header.php index.php single.php
+
+style.css: twentyeleven-fix.scss