Skip to content

Commit

Permalink
Initial local commit
Browse files Browse the repository at this point in the history
  • Loading branch information
krogsgard committed Jan 14, 2014
0 parents commit 3e0b03c
Show file tree
Hide file tree
Showing 39 changed files with 4,500 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
56 changes: 56 additions & 0 deletions 404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* The template for displaying 404 pages (Not Found).
*
* @package wporg-developer
*/

get_header(); ?>

<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">

<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'wporg-developer' ); ?></h1>
</header><!-- .page-header -->

<div class="page-content">
<p><?php _e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'wporg-developer' ); ?></p>

<?php get_search_form(); ?>

<?php the_widget( 'WP_Widget_Recent_Posts' ); ?>

<?php if ( wporg_developer_categorized_blog() ) : // Only show the widget if site has multiple categories. ?>
<div class="widget widget_categories">
<h2 class="widgettitle"><?php _e( 'Most Used Categories', 'wporg-developer' ); ?></h2>
<ul>
<?php
wp_list_categories( array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 10,
) );
?>
</ul>
</div><!-- .widget -->
<?php endif; ?>

<?php
/* translators: %1$s: smiley */
$archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'wporg-developer' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" );
?>

<?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>

</div><!-- .page-content -->
</section><!-- .error-404 -->

</main><!-- #main -->
</div><!-- #primary -->

<?php get_footer(); ?>
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
_s
===

Hi. I'm a starter theme called `_s`, or `underscores`, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.

My ultra-minimal CSS might make me look like theme tartare but that means less stuff to get in your way when you're designing your awesome theme. Here are some of the other more interesting things you'll find here:

* A just right amount of lean, well-commented, modern, HTML5 templates.
* A helpful 404 template.
* A sample custom header implementation in `inc/custom-header.php` that can be activated by uncommenting one line in functions.php and adding the code snippet found the comments of `inc/custom-header.php` to your `header.php` template.
* Custom template tags in `inc/template-tags.php` that keep your templates clean and neat and prevent code duplication.
* Some small tweaks in `inc/extras.php` that can improve your theming experience.
* A script at `js/navigation.js` that makes your menu a toggled dropdown on small screens (like your phone), ready for CSS artistry. It's enqueued in `functions.php`.
* 2 sample CSS layouts in `layouts` for a sidebar on either side of your content.
* Smartly organized starter CSS in `style.css` that will help you to quickly get your design off the ground.
* Licensed under GPLv2 or later. :) Use it to make something cool.

Getting Started
---------------

If you want to keep it simple, head over to http://underscores.me and generate your `_s` based theme from there. You just input the name of the theme you want to create, click the "Generate" button, and you get your ready-to-awesomize starter theme.

If you want to set things up manually, download `_s` from github. The first thing you want to do is copy the `_s` directory and change the name to something else - Like, say, `megatherium` - then you'll need to do a five-step find and replace on the name in all the templates.

1. Search for `'_s'` (inside single quotations) to capture the text domain.
2. Search for `_s_` to capture all the function names.
3. Search for <code>&nbsp;_s</code> (with a space before it) to capture DocBlocks.
4. Search for `_s-` to capture prefixed handles.
5. Search for `Text Domain: _s` in style.css.

OR

* Search for: `'_s'` and replace with: `'megatherium'`
* Search for: `_s_` and replace with: `megatherium_`
* Search for: <code>&nbsp;_s</code> and replace with: <code>&nbsp;Megatherium</code>
* Search for: `_s-` and replace with: `megatherium-`
* Search for: `Text Domain: _s` and replace with: `Text Domain: megatherium` in style.css.

Then, update the stylesheet header in style.css and the links in footer.php with your own information. Next, update or delete this readme.

Now you're ready to go! The next step is easy to say, but harder to do: make an awesome WordPress theme. :)

Good luck!
113 changes: 113 additions & 0 deletions archive.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?php
/**
* The template for displaying Archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package wporg-developer
*/

get_header(); ?>

<section id="primary" class="content-area has-sidebar">
<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<header class="page-header">
<h1 class="page-title">
<?php
if ( is_category() ) :
single_cat_title();

elseif ( is_tag() ) :
single_tag_title();

elseif ( is_author() ) :
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*/
the_post();
printf( __( 'Author: %s', 'wporg-developer' ), '<span class="vcard">' . get_the_author() . '</span>' );
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();

elseif ( is_day() ) :
printf( __( 'Day: %s', 'wporg-developer' ), '<span>' . get_the_date() . '</span>' );

elseif ( is_month() ) :
printf( __( 'Month: %s', 'wporg-developer' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'wporg-developer' ) ) . '</span>' );

elseif ( is_year() ) :
printf( __( 'Year: %s', 'wporg-developer' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'wporg-developer' ) ) . '</span>' );

elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
_e( 'Asides', 'wporg-developer' );

elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
_e( 'Galleries', 'wporg-developer');

elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
_e( 'Images', 'wporg-developer');

elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
_e( 'Videos', 'wporg-developer' );

elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
_e( 'Quotes', 'wporg-developer' );

elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
_e( 'Links', 'wporg-developer' );

elseif ( is_tax( 'post_format', 'post-format-status' ) ) :
_e( 'Statuses', 'wporg-developer' );

elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
_e( 'Audios', 'wporg-developer' );

elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
_e( 'Chats', 'wporg-developer' );

else :
_e( 'Archives', 'wporg-developer' );

endif;
?>
</h1>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>
</header><!-- .page-header -->

<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>

<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>

<?php endwhile; ?>

<?php wporg_developer_paging_nav(); ?>

<?php else : ?>

<?php get_template_part( 'content', 'none' ); ?>

<?php endif; ?>

</main><!-- #main -->
<?php get_sidebar(); ?>
</section><!-- #primary -->
<?php get_footer(); ?>
74 changes: 74 additions & 0 deletions comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to wporg_developer_comment() which is
* located in the inc/template-tags.php file.
*
* @package wporg-developer
*/

/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>

<div id="comments" class="comments-area">

<?php // You can start editing here -- including this comment! ?>

<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'wporg-developer' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
</h2>

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-above" class="comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'wporg-developer' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'wporg-developer' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'wporg-developer' ) ); ?></div>
</nav><!-- #comment-nav-above -->
<?php endif; // check for comment navigation ?>

<ol class="comment-list">
<?php
/* Loop through and list the comments. Tell wp_list_comments()
* to use wporg_developer_comment() to format the comments.
* If you want to override this in a child theme, then you can
* define wporg_developer_comment() and that will be used instead.
* See wporg_developer_comment() in inc/template-tags.php for more.
*/
wp_list_comments( array( 'callback' => 'wporg_developer_comment' ) );
?>
</ol><!-- .comment-list -->

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'wporg-developer' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'wporg-developer' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'wporg-developer' ) ); ?></div>
</nav><!-- #comment-nav-below -->
<?php endif; // check for comment navigation ?>

<?php endif; // have_comments() ?>

<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'wporg-developer' ); ?></p>
<?php endif; ?>

<?php comment_form(); ?>

</div><!-- #comments -->
33 changes: 33 additions & 0 deletions content-none.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* The template part for displaying a message that posts cannot be found.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package wporg-developer
*/
?>

<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Nothing Found', 'wporg-developer' ); ?></h1>
</header><!-- .page-header -->

<div class="page-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>

<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'wporg-developer' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>

<?php elseif ( is_search() ) : ?>

<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'wporg-developer' ); ?></p>
<?php get_search_form(); ?>

<?php else : ?>

<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'wporg-developer' ); ?></p>
<?php get_search_form(); ?>

<?php endif; ?>
</div><!-- .page-content -->
</section><!-- .no-results -->
24 changes: 24 additions & 0 deletions content-page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* The template used for displaying page content in page.php
*
* @package wporg-developer
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="single-entry-title entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->

<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'wporg-developer' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<?php edit_post_link( __( 'Edit', 'wporg-developer' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?>
</article><!-- #post-## -->
Loading

0 comments on commit 3e0b03c

Please sign in to comment.