|
|
@@ -8,42 +8,62 @@ just edit things like thumbnail sizes, header images,
|
|
|
sidebars, comments, ect.
|
|
|
*/
|
|
|
|
|
|
-/************* INCLUDE NEEDED FILES ***************/
|
|
|
+// LOAD BONES CORE (if you remove this, the theme will break)
|
|
|
+require_once( 'library/bones.php' );
|
|
|
|
|
|
-/*
|
|
|
-1. library/bones.php
|
|
|
- - head cleanup (remove rsd, uri links, junk css, ect)
|
|
|
- - enqueueing scripts & styles
|
|
|
- - theme support functions
|
|
|
- - custom menu output & fallbacks
|
|
|
- - related post function
|
|
|
- - page-navi function
|
|
|
- - removing <p> from around images
|
|
|
- - customizing the post excerpt
|
|
|
- - custom google+ integration
|
|
|
- - adding custom fields to user profiles
|
|
|
-*/
|
|
|
-require_once( 'library/bones.php' ); // if you remove this, bones will break
|
|
|
-/*
|
|
|
-2. library/custom-post-type.php
|
|
|
- - an example custom post type
|
|
|
- - example custom taxonomy (like categories)
|
|
|
- - example custom taxonomy (like tags)
|
|
|
-*/
|
|
|
-require_once( 'library/custom-post-type.php' ); // you can disable this if you like
|
|
|
-/*
|
|
|
-3. library/admin.php
|
|
|
- - removing some default WordPress dashboard widgets
|
|
|
- - an example custom dashboard widget
|
|
|
- - adding custom login css
|
|
|
- - changing text in footer of admin
|
|
|
-*/
|
|
|
-// require_once( 'library/admin.php' ); // this comes turned off by default
|
|
|
-/*
|
|
|
-4. library/translation/translation.php
|
|
|
- - adding support for other languages
|
|
|
-*/
|
|
|
-// require_once( 'library/translation/translation.php' ); // this comes turned off by default
|
|
|
+// USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY
|
|
|
+require_once( 'library/custom-post-type.php' );
|
|
|
+
|
|
|
+// CUSTOMIZE THE WORDPRESS ADMIN (off by default)
|
|
|
+// require_once get_template_directory() . 'library/admin.php';
|
|
|
+
|
|
|
+/*********************
|
|
|
+LAUNCH BONES
|
|
|
+Let's get everything up and running.
|
|
|
+*********************/
|
|
|
+
|
|
|
+function bones_ahoy() {
|
|
|
+
|
|
|
+ // let's get language support going, if you need it
|
|
|
+ load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );
|
|
|
+
|
|
|
+ // launching operation cleanup
|
|
|
+ add_action( 'init', 'bones_head_cleanup' );
|
|
|
+ // remove WP version from RSS
|
|
|
+ add_filter( 'the_generator', 'bones_rss_version' );
|
|
|
+ // remove pesky injected css for recent comments widget
|
|
|
+ add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );
|
|
|
+ // clean up comment styles in the head
|
|
|
+ add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );
|
|
|
+ // clean up gallery output in wp
|
|
|
+ add_filter( 'gallery_style', 'bones_gallery_style' );
|
|
|
+
|
|
|
+ // enqueue base scripts and styles
|
|
|
+ add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );
|
|
|
+ // ie conditional wrapper
|
|
|
+
|
|
|
+ // launching this stuff after theme setup
|
|
|
+ bones_theme_support();
|
|
|
+
|
|
|
+ // adding sidebars to Wordpress (these are created in functions.php)
|
|
|
+ add_action( 'widgets_init', 'bones_register_sidebars' );
|
|
|
+
|
|
|
+ // cleaning up random code around images
|
|
|
+ add_filter( 'the_content', 'bones_filter_ptags_on_images' );
|
|
|
+ // cleaning up excerpt
|
|
|
+ add_filter( 'excerpt_more', 'bones_excerpt_more' );
|
|
|
+
|
|
|
+} /* end bones ahoy */
|
|
|
+
|
|
|
+// let's get this party started
|
|
|
+add_action( 'after_setup_theme', 'bones_ahoy' );
|
|
|
+
|
|
|
+
|
|
|
+/************* OEMBED SIZE OPTIONS *************/
|
|
|
+
|
|
|
+if ( ! isset( $content_width ) ) {
|
|
|
+ $content_width = 640;
|
|
|
+}
|
|
|
|
|
|
/************* THUMBNAIL SIZE OPTIONS *************/
|
|
|
|
|
|
@@ -110,56 +130,61 @@ function bones_register_sidebars() {
|
|
|
*/
|
|
|
} // don't remove this bracket!
|
|
|
|
|
|
+
|
|
|
/************* COMMENT LAYOUT *********************/
|
|
|
|
|
|
// Comment Layout
|
|
|
function bones_comments( $comment, $args, $depth ) {
|
|
|
$GLOBALS['comment'] = $comment; ?>
|
|
|
- <li <?php comment_class(); ?>>
|
|
|
- <article id="comment-<?php comment_ID(); ?>" class="clearfix">
|
|
|
- <header class="comment-author vcard">
|
|
|
- <?php
|
|
|
- /*
|
|
|
- this is the new responsive optimized comment image. It used the new HTML5 data-attribute to display comment gravatars on larger screens only. What this means is that on larger posts, mobile sites don't have a ton of requests for comment images. This makes load time incredibly fast! If you'd like to change it back, just replace it with the regular wordpress gravatar call:
|
|
|
- echo get_avatar($comment,$size='32',$default='<path_to_url>' );
|
|
|
- */
|
|
|
- ?>
|
|
|
- <!-- custom gravatar call -->
|
|
|
- <?php
|
|
|
- // create variable
|
|
|
- $bgauthemail = get_comment_author_email();
|
|
|
- ?>
|
|
|
- <img data-gravatar="http://www.gravatar.com/avatar/<?php echo md5( $bgauthemail ); ?>?s=32" class="load-gravatar avatar avatar-48 photo" height="32" width="32" src="<?php echo get_template_directory_uri(); ?>/library/images/nothing.gif" />
|
|
|
- <!-- end custom gravatar call -->
|
|
|
- <?php printf(__( '<cite class="fn">%s</cite>', 'bonestheme' ), get_comment_author_link()) ?>
|
|
|
- <time datetime="<?php echo comment_time('Y-m-j'); ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php comment_time(__( 'F jS, Y', 'bonestheme' )); ?> </a></time>
|
|
|
- <?php edit_comment_link(__( '(Edit)', 'bonestheme' ),' ','') ?>
|
|
|
- </header>
|
|
|
- <?php if ($comment->comment_approved == '0') : ?>
|
|
|
- <div class="alert alert-info">
|
|
|
- <p><?php _e( 'Your comment is awaiting moderation.', 'bonestheme' ) ?></p>
|
|
|
- </div>
|
|
|
- <?php endif; ?>
|
|
|
- <section class="comment_content clearfix">
|
|
|
- <?php comment_text() ?>
|
|
|
- </section>
|
|
|
- <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
|
|
|
- </article>
|
|
|
- <!-- </li> is added by WordPress automatically -->
|
|
|
+ <div id="comment-<?php comment_ID(); ?>" <?php comment_class('cf'); ?>>
|
|
|
+ <article class="cf">
|
|
|
+ <header class="comment-author vcard">
|
|
|
+ <?php
|
|
|
+ /*
|
|
|
+ this is the new responsive optimized comment image. It used the new HTML5 data-attribute to display comment gravatars on larger screens only. What this means is that on larger posts, mobile sites don't have a ton of requests for comment images. This makes load time incredibly fast! If you'd like to change it back, just replace it with the regular wordpress gravatar call:
|
|
|
+ echo get_avatar($comment,$size='32',$default='<path_to_url>' );
|
|
|
+ */
|
|
|
+ ?>
|
|
|
+ <?php // custom gravatar call ?>
|
|
|
+ <?php
|
|
|
+ // create variable
|
|
|
+ $bgauthemail = get_comment_author_email();
|
|
|
+ ?>
|
|
|
+ <img data-gravatar="http://www.gravatar.com/avatar/<?php echo md5( $bgauthemail ); ?>?s=40" class="load-gravatar avatar avatar-48 photo" height="40" width="40" src="<?php echo get_template_directory_uri(); ?>/library/images/nothing.gif" />
|
|
|
+ <?php // end custom gravatar call ?>
|
|
|
+ <?php printf(__( '<cite class="fn">%1$s</cite> %2$s', 'bonestheme' ), get_comment_author_link(), edit_comment_link(__( '(Edit)', 'bonestheme' ),' ','') ) ?>
|
|
|
+ <time datetime="<?php echo comment_time('Y-m-j'); ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php comment_time(__( 'F jS, Y', 'bonestheme' )); ?> </a></time>
|
|
|
+
|
|
|
+ </header>
|
|
|
+ <?php if ($comment->comment_approved == '0') : ?>
|
|
|
+ <div class="alert alert-info">
|
|
|
+ <p><?php _e( 'Your comment is awaiting moderation.', 'bonestheme' ) ?></p>
|
|
|
+ </div>
|
|
|
+ <?php endif; ?>
|
|
|
+ <section class="comment_content cf">
|
|
|
+ <?php comment_text() ?>
|
|
|
+ </section>
|
|
|
+ <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
|
|
|
+ </article>
|
|
|
+ <?php // </li> is added by WordPress automatically ?>
|
|
|
<?php
|
|
|
} // don't remove this bracket!
|
|
|
|
|
|
-/************* SEARCH FORM LAYOUT *****************/
|
|
|
|
|
|
-// Search Form
|
|
|
-function bones_wpsearch($form) {
|
|
|
- $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
|
|
|
- <label class="screen-reader-text" for="s">' . __( 'Search for:', 'bonestheme' ) . '</label>
|
|
|
- <input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="' . esc_attr__( 'Search the Site...', 'bonestheme' ) . '" />
|
|
|
- <input type="submit" id="searchsubmit" value="' . esc_attr__( 'Search' ) .'" />
|
|
|
- </form>';
|
|
|
- return $form;
|
|
|
-} // don't remove this bracket!
|
|
|
+/*
|
|
|
+This is a modification of a function found in the
|
|
|
+twentythirteen theme where we can declare some
|
|
|
+external fonts. If you're using Google Fonts, you
|
|
|
+can replace these fonts, change it in your scss files
|
|
|
+and be up and running in seconds.
|
|
|
+*/
|
|
|
+function bones_fonts() {
|
|
|
+ wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic');
|
|
|
+ wp_enqueue_style( 'googleFonts');
|
|
|
+}
|
|
|
+
|
|
|
+add_action('wp_print_styles', 'bones_fonts');
|
|
|
+
|
|
|
|
|
|
|
|
|
-?>
|
|
|
+/* DON'T DELETE THIS CLOSING TAG */ ?>
|