Skip to content

Commit

Permalink
Updated jQuery, added has-children action, converted tabs to 4 spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAdamDavis committed Mar 23, 2013
1 parent 7e5bce5 commit a9708c4
Show file tree
Hide file tree
Showing 18 changed files with 325 additions and 320 deletions.
2 changes: 1 addition & 1 deletion 404.php
@@ -1,6 +1,6 @@
<?php get_header(); ?>

<h1>Error 404 - Not Found</h1>
<h1>Error 404 - Not Found</h1>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
7 changes: 1 addition & 6 deletions README.md
@@ -1,8 +1,3 @@
# Slim Starkers

* A super simple theme, that has just what you need in the template files.
* No need to do a clear out before you start coding.
* Any styling is purely optional and can be removed easily.
* The `functions.php` file is full of power. Explore!

Maintained by [Paul Adam Davis](http://codebymonkey.com), but loved by many.
Maintained by [Paul Adam Davis](http://codebymonkey.com), but loved by many. Repo at [Github](https://github.com/PaulAdamDavis/Slim-Starkers)
35 changes: 19 additions & 16 deletions admin/settings.php
@@ -1,34 +1,37 @@
<?php

// create custom plugin settings menu
add_action('admin_menu', 'slim_create_menu');

function slim_create_menu() {
//create new top-level menu
add_menu_page('Slim Settings', 'Slim Settings', 'administrator', __FILE__, 'slim_settings_page');
//call register settings function
add_action( 'admin_init', 'register_mysettings' );
add_action('admin_menu', 'extra_settings_menu');

function extra_settings_menu() {
add_menu_page('Extra Settings', 'Extra Settings', 'administrator', __FILE__, 'extra_settings_html');
add_action('admin_init', 'register_mysettings');
}

function register_mysettings() {
//register our settings
register_setting( 'slim_settings_group', 'slim_ga_tracking_code' );
register_setting('extra_settings_group', 'ga_tracking_code');
}

function slim_settings_page() { ?>
function extra_settings_html() { ?>
<div class="wrap">
<h2>Slim Settings</h2>

<h2>Extra Settings</h2>

<form method="post" action="options.php">
<?php settings_fields('slim_settings_group'); ?>

<?php settings_fields('extra_settings_group'); ?>

<table class="form-table">
<tr valign="top">
<th scope="row">Google Tracking Code</th>
<td><input name="slim_ga_tracking_code" value="<?php echo get_option('slim_ga_tracking_code'); ?>" /></td>
<th>Google Tracking UA Code</th>
<td><input type="text" name="ga_tracking_code" value="<?php echo get_option('ga_tracking_code'); ?>" placeholder="UA-1234567-89" /></td>
</tr>
</table>

<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
<input type="submit" class="button-primary" value="Save Changes" />
</p>

</form>

</div>
<?php }
109 changes: 52 additions & 57 deletions archive.php
@@ -1,69 +1,64 @@
<?php get_header(); ?>

<?php if (have_posts()) :
// AO: Calling the post to make the date work
the_post();
?>
<?php if (have_posts()) : the_post(); ?>

<?php if (is_category()) { ?>
<h1>Archive for the &#8216;<?php single_cat_title(); ?>&#8217; Category</h1>
<?php } elseif( is_tag() ) { ?>
<h1>Posts Tagged &#8216;<?php single_tag_title(); ?>&#8217;</h1>
<?php } elseif (is_day()) { ?>
<h1>Archive for <?php the_time('F jS, Y'); ?></h1>
<?php } elseif (is_month()) { ?>
<h1>Archive for <?php the_time('F, Y'); ?></h1>
<?php } elseif (is_year()) { ?>
<h1>Archive for <?php the_time('Y'); ?></h1>
<?php } elseif (is_author()) { ?>
<h1>Author Archive</h1>
<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h1>Blog Archives</h1>
<?php } ?>
<?php if (is_category()) { ?>
<h1>Archive for the &#8216;<?php single_cat_title(); ?>&#8217; Category</h1>
<?php } elseif( is_tag() ) { ?>
<h1>Posts Tagged &#8216;<?php single_tag_title(); ?>&#8217;</h1>
<?php } elseif (is_day()) { ?>
<h1>Archive for <?php the_time('F jS, Y'); ?></h1>
<?php } elseif (is_month()) { ?>
<h1>Archive for <?php the_time('F, Y'); ?></h1>
<?php } elseif (is_year()) { ?>
<h1>Archive for <?php the_time('Y'); ?></h1>
<?php } elseif (is_author()) { ?>
<h1>Author Archive</h1>
<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h1>Archives</h1>
<?php } ?>

<?php
// AO: Calling rewind to go back to the first post as we called it above to get the date to work
rewind_posts(); ?>
<?php rewind_posts(); ?>

<?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?>>
<h1 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
</h1>
<time datetime="<?php the_time('Y-m-d') ?>" pubdate><?php the_time('l, F jS, Y') ?></time>
<?php if (has_post_thumbnail()) { ?>
<a href="<?php the_permalink() ?>">
<?php
$src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium', false, '' );
echo '<img class="postThumb" src="'. $src[0] .'" />';
?>
</a>
<?php } ?>
<?php the_content() ?>
<?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?>
</article>
<?php endwhile; ?>
<?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?>>
<h1 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
</h1>
<time datetime="<?php the_time('Y-m-d') ?>" pubdate><?php the_time('l, F jS, Y') ?></time>
<?php if (has_post_thumbnail()) { ?>
<a href="<?php the_permalink() ?>">
<?php
$src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium', false, '' );
echo '<img src="'. $src[0] .'" />';
?>
</a>
<?php } ?>
<?php the_content() ?>
<?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?>
</article>
<?php endwhile; ?>

<?php if (show_posts_nav()) : ?>
<nav class="nextPrevLinks">
<?php my_paginate_links(); ?>
</nav>
<?php endif; ?>
<?php if (show_posts_nav()) : ?>
<nav class="nextPrevLinks">
<?php my_paginate_links(); ?>
</nav>
<?php endif; ?>

<?php else :
<?php else :

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

endif; ?>
endif; ?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
112 changes: 56 additions & 56 deletions comments.php
@@ -1,69 +1,69 @@
<?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!');
// 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()) {
echo '<p class="alert">This post is password protected. Enter the password to view comments.</p>';
return;
}

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

?>

<?php if (have_comments()) : ?>
<h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3> <!-- View functions.php for comment markup -->
<h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3> <!-- View functions.php for comment markup -->
<ol id="commentList">
<?php foreach ($comments as $comment) : ?>
<li class="comment-item <?php if (1 == $comment->user_id) $oddcomment = "authcomment"; echo $oddcomment; ?>">
<div class="left">
<a class="comment-item-gravatar" href="<?php comment_author_url(); ?>"><?php echo get_avatar($comment, 80); ?></a>
</div>
<div class="right">
<span class="author"><?php comment_author_link() ?> - <?php comment_date('F jS, Y') ?> at <?php comment_time() ?></span>
<?php if ($comment->comment_approved == '0') : ?>
<p>Your comment is awaiting moderation.</p>
<?php endif; ?>
<?php comment_text() ?>
</div>
</li>
<?php
endforeach; // end for each comment
?>
</ol>
<?php previous_comments_link() ?> <?php next_comments_link() ?>
<?php foreach ($comments as $comment) : ?>
<li class="comment-item <?php if (1 == $comment->user_id) $oddcomment = "authcomment"; echo $oddcomment; ?>">
<div class="left">
<a class="comment-item-gravatar" href="<?php comment_author_url(); ?>"><?php echo get_avatar($comment, 80); ?></a>
</div>
<div class="right">
<span class="author"><?php comment_author_link() ?> - <?php comment_date('F jS, Y') ?> at <?php comment_time() ?></span>
<?php if ($comment->comment_approved == '0') : ?>
<p>Your comment is awaiting moderation.</p>
<?php endif; ?>
<?php comment_text() ?>
</div>
</li>
<?php
endforeach; // end for each comment
?>
</ol>
<?php previous_comments_link() ?> <?php next_comments_link() ?>
<?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 ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>
<?php if (comments_open()) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>
<?php endif; ?>


<?php if (comments_open()) : ?>
<h3 id="respond"><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
<p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p>
<?php if (get_option('comment_registration') && !is_user_logged_in()) : ?>
<p>You must be <a href="<?php echo wp_login_url(get_permalink()); ?>">logged in</a> to post a comment.</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>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>
<?php else : ?>
<label for="author">Name (required)</label>
<input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" required />
<label for="email">Mail (will not be published) (required)</label>
<input type="email" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" required />
<label for="url">Website</label>
<input type="url" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" />
<?php endif; ?>
<textarea name="comment" id="comment" cols="40" rows="10" required></textarea>
<button type="submit" name="submit" id="send">Submit Comment</button>
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; ?>
<h3 id="respond"><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
<p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p>
<?php if (get_option('comment_registration') && !is_user_logged_in()) : ?>
<p>You must be <a href="<?php echo wp_login_url(get_permalink()); ?>">logged in</a> to post a comment.</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>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>
<?php else : ?>
<label for="author">Name (required)</label>
<input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" required />

<label for="email">Mail (will not be published) (required)</label>
<input type="email" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" required />

<label for="url">Website</label>
<input type="url" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" />
<?php endif; ?>
<textarea name="comment" id="comment" cols="40" rows="10" required></textarea>
<button type="submit" name="submit" id="send">Submit Comment</button>
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; ?>
<?php endif; ?>
25 changes: 13 additions & 12 deletions footer.php
@@ -1,17 +1,18 @@
<footer>
<small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small>
</footer>

</div><!-- end .wrapper -->

<!-- JavaScript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="<?php bloginfo('template_url'); ?>/js/jquery-1.7.2.min.js"><\/script>')</script>
<script src="<?php bloginfo('template_url'); ?>/js/scripts.js"></script>

<footer>
<small>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small>
</footer>

</div><!-- end .wrapper -->

<!-- JavaScript / jQuery with migrate plugin inc in local file -->
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.1.1.min.js"></script>
<script>window.jQuery || document.write('<script src="<?php bloginfo('template_url'); ?>/js/jquery-1.9.1.min.js"><\/script>')</script>
<script src="<?php bloginfo('template_url'); ?>/js/scripts.js"></script>

<?php wp_footer(); ?>

<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->
<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->

</body>
</html>

0 comments on commit a9708c4

Please sign in to comment.