Skip to content

Commit

Permalink
your a n00b
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Harris committed Jul 15, 2011
1 parent 0b48772 commit 3faad45
Show file tree
Hide file tree
Showing 17 changed files with 526 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php get_header(); ?>

<article class="noposts">
<h2>404 - Content Not Found</h2>
<p>We don't seem to be able to find the content you have requested - why not try a search below?</p>
<?php get_search_form(); ?>
</article>

<?php get_footer(); ?>
67 changes: 67 additions & 0 deletions archive.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php get_header(); ?>

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

<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2>Archive for the &#8216;<?php single_cat_title(); ?>&#8217; Category</h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2>Posts Tagged &#8216;<?php single_tag_title(); ?>&#8217;</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2>Archive for <?php the_time('F jS, Y'); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2>Archive for <?php the_time('F, Y'); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2>Archive for <?php the_time('Y'); ?></h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2>Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2>Blog Archives</h2>
<?php } ?>

<?php while (have_posts()) : the_post(); ?>

<article <?php post_class() ?> id="post-<?php the_ID(); ?>">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<time><?php the_time(get_option('date_format')) ?></time>

<div>
<?php the_content('Read the rest of this entry &raquo;'); ?>
<p class="postmetadata"><?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('Share your thoughts on this', '1 Comment', '% Comments'); ?></p>
</div>

</article>

<?php endwhile; ?>

<ul class="prevnext">
<li><?php next_posts_link('&lt; Older Entries') ?></li>
<li><?php previous_posts_link('Newer Entries &gt;') ?></li>
</ul>

<?php else : ?>

<article>

<?php

if ( is_category() ) { // If this is a category archive
printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
} else if ( is_date() ) { // If this is a date archive
echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
} else if ( is_author() ) { // If this is a category archive
$userdata = get_userdatabylogin(get_query_var('author_name'));
printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
} else {
echo("<h2 class='center'>No posts found.</h2>");
}
get_search_form();

?>

</article>

<?php endif; ?>

<?php get_footer(); ?>
25 changes: 25 additions & 0 deletions archives.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/*
Template Name: Archives
*/
?>

<?php get_header(); ?>

<div id="content" class="widecolumn">

<?php get_search_form(); ?>

<h2>Archives by Month:</h2>
<ul>
<?php wp_get_archives(array('type' => 'monthly')); ?>
</ul>

<h2>Archives by Subject:</h2>
<ul>
<?php wp_list_categories(); ?>
</ul>

</div>

<?php get_footer(); ?>
49 changes: 49 additions & 0 deletions comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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!');

if ( post_password_required() ) { ?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
?>

<!-- You can start editing here. -->

<?php if ( have_comments() ) : ?>
<h3 id="comments"><?php comments_number('No Comments', 'One Comment', '% Comments' );?> </h3>

<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>


<ol class="commentlist">
<?php wp_list_comments(array('avatar_size' => 70)); ?>
</ol>

<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<?php else : // this is displayed if there are no comments so far ?>

<?php if ( comments_open() ) : ?>
<!-- If comments are open, but there are no comments. -->

<?php else : // comments are closed ?>
<?php if(!is_page()) { ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php } ?>

<?php endif; ?>
<?php endif; ?>


<?php if (comments_open()) : ?>
<?php comment_form(); ?>
<?php endif; // if you delete this the sky will fall on your head ?>
16 changes: 16 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
</section>

<?php get_sidebar(); ?>

<footer>
<p>
asdf
</p>
</footer>

<?php wp_footer(); ?>

</div>

</body>
</html>
16 changes: 16 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

wp_register_script('html5_shim', get_template_directory_uri() . '/html5.js');

if ( ! isset( $content_width ) ) $content_width = 550;

register_sidebar(array(
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>',
));

add_theme_support('automatic-feed-links');

?>
22 changes: 22 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php wp_title('&laquo;', true, 'right'); bloginfo( 'name' ); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php if (!is_admin()) { wp_enqueue_script('html5_shim'); } ?>
<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

<div id="wrapper">

<header>
<h1><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a></h1>
<!--<?php bloginfo('description'); ?>-->
</header>

<section>
6 changes: 6 additions & 0 deletions html5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
document.createElement('header');
document.createElement('footer');
document.createElement('section');
document.createElement('aside');
document.createElement('nav');
document.createElement('article');
36 changes: 36 additions & 0 deletions image.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php get_header(); ?>


<?php if (have_posts()) : while (have_posts()) : the_post(); ?>


<article <?php post_class() ?> id="post-<?php the_ID(); ?>">

<h2><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> &raquo; <?php the_title(); ?></h2>
<div class="entry">
<p class="attachment"><a href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?></a></p>
<div class="caption"><?php if ( !empty($post->post_excerpt) ) the_excerpt(); // this is the "caption" ?></div>

<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>

<div class="navigation">
<div class="alignleft"><?php previous_image_link() ?></div>
<div class="alignright"><?php next_image_link() ?></div>
</div>

<hr class="clearfix" />

</div>

</article>

<?php comments_template(); ?>

<?php endwhile; else: ?>

<p>Sorry, no attachments matched your criteria.</p>

<?php endif; ?>


<?php get_footer(); ?>
40 changes: 40 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php get_header(); ?>

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

<?php while (have_posts()) : the_post(); ?>

<article <?php post_class() ?> id="post-<?php the_ID(); ?>">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<time><?php the_time(get_option('date_format')) ?></time>

<?php the_content('Read the rest of this entry &raquo;'); ?>

<hr class="clearfix" />

<?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=page %'); ?>

<p class="postmetadata"><?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('Share your thoughts', '1 Comment', '% Comments'); ?></p>

</article>

<?php endwhile; ?>

<ul class="prevnext">
<li><?php next_posts_link('&lt; Older Entries') ?></li>
<li><?php previous_posts_link('Newer Entries &gt;') ?></li>
</ul>

<?php else : ?>

<article class="noposts">
<h2>404 - Content Not Found</h2>
<p>We don't seem to be able to find the content you have requested - why not try a search below?</p>
<?php get_search_form(); ?>
</article>

<?php endif; ?>


<?php get_footer(); ?>
17 changes: 17 additions & 0 deletions links.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/*
Template Name: Links
*/
?>

<?php get_header(); ?>

<article id="links">
<h2>Links:</h2>
<ul>
<?php wp_list_bookmarks(); ?>
</ul>

</article>

<?php get_footer(); ?>
29 changes: 29 additions & 0 deletions page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php get_header(); ?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<article <?php post_class() ?> id="post-<?php the_ID(); ?>">

<h2><?php the_title(); ?></h2>

<?php the_content('Read the rest of this entry &raquo;'); ?>

<hr class="clearfix" />

<?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=page %'); ?>

<?php edit_post_link('Edit', '<p>', '</p>'); ?>

<hr class="clearfix" />

</article>

<?php comments_template(); ?>

<?php endwhile; else: ?>

<p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>

<?php get_footer(); ?>
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php get_header(); ?>

<article id="search-results">

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

<h2 class="pagetitle">Search Results for &quot;<?php the_search_query(); ?> &quot;</h2>

<?php while (have_posts()) : the_post(); ?>

<div <?php post_class() ?>>
<h3 id="post-<?php the_ID(); ?>">&bull; <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<small><?php the_time(get_option('date_format')) ?></small>
</div>

<?php endwhile; ?>

<div class="navigation">
<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
</div>

<?php else : ?>

<h2 class="center">No posts found. Try a different search?</h2>
<?php get_search_form(); ?>

<?php endif; ?>

</article>

<?php get_footer(); ?>
Loading

0 comments on commit 3faad45

Please sign in to comment.