Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Showing with 16 additions and 6 deletions.
  1. +14 −1 functions.php
  2. +0 −2 header.php
  3. +0 −1 image.php
  4. +2 −2 readme.txt
View
15 functions.php
@@ -97,11 +97,24 @@ function _s_widgets_init() {
add_action( 'widgets_init', '_s_widgets_init' );
/**
- * Enqueue scripts
+ * Enqueue scripts and styles
*/
function _s_scripts() {
+ global $post;
+
+ wp_enqueue_style( 'style', get_template_directory_uri() . '/style.css' );
+
wp_enqueue_script( 'jquery' );
+
wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', 'jquery', '20120206', true );
+
+ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
+ wp_enqueue_script( 'comment-reply' );
+ }
+
+ if ( is_singular() && wp_attachment_is_image( $post->ID ) ) {
+ wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
+ }
}
add_action( 'wp_enqueue_scripts', '_s_scripts' );
View
2 header.php
@@ -34,8 +34,6 @@
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
-<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
-<?php if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
View
1 image.php
@@ -7,7 +7,6 @@
*/
get_header();
-wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
?>
<div id="primary" class="site-content image-attachment">
View
4 readme.txt
@@ -10,8 +10,8 @@ My ultra-minimal CSS might make me look like theme tartare but that means less s
* Custom template tags in inc/template-tags that keep your templates clean and neat and prevent code duplication.
* Sample theme options in /inc/theme-options/ that can can be activated by uncommenting one line in functions.php.
* Some small tweaks in /inc/tweaks.php that can improve your theming experience. They can be activated by uncommenting one line in functions.php.
-* Keyboard navigation for image attachment templates. The script can be found in js/keyboard-navigation.js and is enqueued from the image attachment template, image.php.
-* A script at js/small-menu.js that makes your menu a toggled dropdown on small screens, ready for CSS artistry. It’s enqueued in functions.php.
+* Keyboard navigation for image attachment templates. The script can be found in js/keyboard-navigation.js. It’s enqueued in functions.php.
+* A script at js/small-menu.js that makes your menu a toggled dropdown on small screens (like your phone), ready for CSS artistry. It’s enqueued in functions.php.
* 5 sample CSS layouts in /layouts: Two sidebars on the left, two sidebars on the right, a sidebar on either side of your content, and two-column layouts with sidebars on either side.
* Smartly organized starter CSS in style.css that will help you to quickly get your design off the ground.
* The GPL license in license.txt. :) Use it to make something cool.

No commit comments for this range

Something went wrong with that request. Please try again.