Permalink
Browse files

Added support for Jetpack Infinite Scroll module. Rearranged some mor…

…e functions into appropriate files.
  • Loading branch information...
1 parent 45e2ee5 commit 52c9ff6e3a5ad9797c9520b9d2c64d83701a4358 @jeremyclark13 committed Nov 29, 2012
Showing with 272 additions and 265 deletions.
  1. +5 −0 content-aside.php
  2. +5 −0 content-quote.php
  3. +6 −0 content-status.php
  4. +51 −0 content.php
  5. +9 −96 functions.php
  6. +37 −0 functions/tech-comments-functions.php
  7. +2 −5 functions/tech-css.php
  8. +97 −1 functions/tech-template-tags.php
  9. +12 −1 index.php
  10. +0 −93 loop.php
  11. +1 −0 readme.txt
  12. +29 −69 style.css
  13. +18 −0 tech-ads.php
View
@@ -0,0 +1,5 @@
+<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
+ <div class="entry">
+ <?php the_content(); ?>
+ </div>
+</div>
View
@@ -0,0 +1,5 @@
+<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
+ <div class="entry">
+ <?php the_content(); ?>
+ </div>
+</div>
View
@@ -0,0 +1,6 @@
+<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
+ <div class="avatar"><a href="<?php echo add_query_arg( 'post_format', 'status', get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php _e( 'View all status updates by this author', 'techozoic' ); ?>"><?php echo get_avatar( get_the_author_meta( 'ID' ), 64 ); ?></a></div>
+ <div class="entry">
+ <?php the_content(); ?>
+ </div>
+</div>
View
@@ -0,0 +1,51 @@
+<?php $date_format = get_option( 'date_format' ); ?>
+<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
+ <div class="heading clear">
+ <h2 class="post_title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( __( 'Permanent Link to %s', 'techozoic' ), get_the_title() ); ?>">
+ <?php
+ if ( get_the_title() ) {
+ the_title();
+ } else {
+ _e( 'Read More &hellip;', 'techozoic' );
+ }
+ ?></a></h2>
+ <small><?php printf( __( 'Posted %s By %s', 'techozoic' ), get_the_time( $date_format ), get_the_author() ); ?><?php edit_post_link( __( '&nbsp;|&nbsp; Edit.', 'techozoic' ), '', '' ); ?></small>
+ </div>
+ <?php if ( $post->post_content != "" ) { ?>
+ <div class="entry">
+ <?php
+ if ( function_exists( 'the_post_thumbnail' ) ) {
+ the_post_thumbnail( 'thumbnail' );
+ }
+ ?>
+ <?php
+ if ( (is_home() && tech_excerpt( 'main' )) || ( is_category() && tech_excerpt( 'cat' ) ) || ( is_year() && tech_excerpt( 'year' ) ) || ( is_month() && tech_excerpt( 'month' ) ) ) {
+ the_excerpt();
+ } else {
+ the_content( __( 'Read the remainder of this entry &raquo;', 'techozoic' ) );
+ }
+ wp_link_pages();
+ if ( comments_open() && empty( $post->post_password ) && (of_get_option( 'comment_preview', '1' ) == "1") ) {
+ ?>
+ <div class="post_comment_cont">
+ <?php comments_popup_link( __( 'Be the first to comment', 'techozoic' ), __( '1 Comment. Join the Conversation', 'techozoic' ), _n( '% Comment so far. Join the Conversation', '% Comments so far. Join the Conversation', get_comments_number(), 'techozoic' ), 'comments-link', __( 'Comments Closed', 'techozoic' ) ); ?>
+ </div>
+ <?php tech_comment_preview( $post->ID ); ?>
+ <?php
+ }
+ ?>
+ <div class="post_info">
+ <small>
+ <?php printf( __( 'Filed in %s', 'techozoic' ), get_the_category_list( ', ' ) ) ?><?php the_tags( __( ' | Tagged: ' ) ); ?>
+ </small>
+ </div>
+ </div>
+ <?php if ( ( is_home() && tech_icons( 'main' ) ) || ( is_category() && tech_icons( 'archive' ) ) || ( is_year() && tech_icons( 'year' ) ) || ( is_month() && tech_icons( 'month' ) ) ) { ?>
+ <div class="top">
+ <?php tech_social_icons( $home = true ); ?><a href="#top" title="<?php _e( 'To the top', 'techozoic' ) ?>" class="social toplink"></a>
+ </div>
+ <?php
+ } // End if $post->post-content blank check.
+ } //End if post format check
+ ?>
+</div>
View
@@ -71,6 +71,11 @@ function techozoic_setup() {
//WP Post Format
add_theme_support( 'bbpress' );
//bbPress Support
+ add_theme_support ( 'infinite-scroll', array(
+ 'container' => 'content',
+ 'footer' => 'page',
+ 'footer_widgets' => 'tech_footer',
+ ));
register_nav_menus( array(
'primary' => __( 'Header Navigation', 'techozoic' ),
'sidebar' => __( 'Sidebar Navigation', 'techozoic' ),
@@ -515,6 +520,10 @@ function tech_plus_one() {
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
+ jQuery( document.body ).on( 'post-load', function() {
+ if ( typeof gapi !== 'undefined')
+ gapi.plusone.go(\"content\");
+});;
</script>";
}
@@ -863,67 +872,6 @@ function tech_show_sidebar( $loc ) {
}
}
-/**
- * Techozoic Social Media Icons Function
- *
- * Echos the social media icon links and images as set in options.
- *
- *
- * @param bool $home whether the function called from home page or single page
- *
- * @access public
- * @since 1.8.8
- */
-
-function tech_social_icons( $home = true ) {
- global $post;
- if ( has_post_thumbnail( $post->ID ) ) {
- $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
- }
- $short_link = home_url() . "/?p=" . $post->ID;
- $home_icons = of_get_option( 'home_social_icons', array( 'delicious' => '1', 'digg' => '1', 'rss' => '1' ) );
- $single_icons = of_get_option( 'single_social_icons', array( 'delicious' => '1', 'digg' => '1', 'rss' => '1' ) );
- $image = get_template_directory_uri() . "/images/icons";
- $link = get_permalink();
- $title = $post->post_title;
- $email_title = preg_replace( '/&/i', 'and', $title );
- $url_title = urlencode( $post->post_title );
- $excerpt = urlencode( wp_trim_excerpt( $post->post_excerpt ) );
- $excerpt_mail = wp_trim_excerpt( $post->post_excerpt );
- $excerpt_mail = preg_replace( "/&#?[a-z0-9]{2,8};/i", "", $excerpt_mail );
- $home_title = urlencode( get_bloginfo( 'name' ) );
- $social_links = array(
- "delicious" => "<a href='http://delicious.com/post?url={$link}&amp;title={$url_title}' title='" . __( 'del.icio.us this!', 'techozoic' ) . "' target='_blank' class='social delicious'></a>",
- "digg" => "<a href='http://digg.com/submit?phase=2&amp;url={$link}&amp;title={$url_title}' title='" . __( 'Digg this!', 'techozoic' ) . "' target='_blank' class='social digg'></a>",
- "email" => "<a href='mailto:?subject={$email_title}&amp;body={$excerpt_mail} {$link}' title='" . __( 'Share this by email.', 'techozoic' ) . "' class='social email'></a>",
- "facebook" => "<a href='http://www.facebook.com/share.php?u={$link}&amp;t={$url_title}' title='" . __( 'Share on Facebook!', 'techozoic' ) . "' target='_blank' class='social facebook'></a>",
- "linkedin" => "<a href ='http://www.linkedin.com/shareArticle?mini=true&amp;url={$link}&amp;title={$url_title}&amp;summary={$excerpt}&amp;source={$home_title}' title='" . __( 'Share on LinkedIn!', 'techozoic' ) . "' target='_blank' class='social linkedin'></a>",
- "myspace" => "<a href='http://www.myspace.com/Modules/PostTo/Pages/?u={$link}&amp;t={$url_title}' title='" . __( 'Share on Myspace!', 'techozoic' ) . "' target='_blank' class='social myspace'></a>",
- "newsvine" => "<a href='http://www.newsvine.com/_tools/seed&amp;save?u={$link}' title='" . __( 'Share on NewsVine!', 'techozoic' ) . "' target='_blank' class='social newsvine'></a>",
- "stumbleupon" => "<a href='http://www.stumbleupon.com/submit?url={$link}&amp;title={$url_title}' title='" . __( 'Stumble Upon this!', 'techozoic' ) . "' target='_blank' class='social stumble'></a>",
- "twitter" => "<a href='http://twitter.com/home?status=Reading%20{$url_title}%20on%20{$short_link}' title='" . __( 'Tweet this!', 'techozoic' ) . "' target='_blank' class='social twitter'></a>",
- "reddit" => "<a href='http://reddit.com/submit?url={$link}&amp;title={$url_title}' title='" . __( 'Share on Reddit!', 'techozoic' ) . "' target='_blank' class='social reddit'></a>",
- "rss" => "<a href='" . get_post_comments_feed_link() . "' title='" . __( 'Subscribe to Feed', 'techozoic' ) . "' class='social feed'></a>",
- "pintrest" => "<a href='http://pinterest.com/pin/create/button/?url={$link}&amp;media={$image}&amp;description={$excerpt}' class='pin-it-button' count-layout='none'><img src='//assets.pinterest.com/images/PinExt.png' title='Pin It' /></a>",
- "google" => "<g:plusone size='small' annotation='none' expandto='right' href='$link'></g:plusone>" );
- if ( $home == true ) {
- if ( is_array( $home_icons ) ) {
- foreach ( $home_icons as $key => $value ) {
- if ( $value == "1" ) {
- echo $social_links[$key] . "&nbsp;";
- }
- }
- }
- } else {
- if ( is_array( $single_icons ) ) {
- foreach ( $single_icons as $key => $value ) {
- if ( $value == "1" ) {
- echo $social_links[$key] . "&nbsp;";
- }
- }
- }
- }
-}
/**
* Techozoic About Icons Function
@@ -960,42 +908,7 @@ function tech_about_icons( $fb = 0, $my = 0, $twitter = 0, $google = 0 ) {
}
}
-/**
- * Techozoic Home Page Comment Preview
- *
- * Comment preview section on home page. Pull comment excerpt for approved comments
- * displays in an unordered list at bottom of each post.
- *
- * @param string $ID id of current post to pull comments for
- *
- * @access public
- * @since 1.8.7
- */
-function tech_comment_preview( $ID ) {
- global $comment;
- $tech_comment_num = of_get_option( 'comment_preview_num', '3' );
- $output = "";
- $comment_array = get_comments( array( 'post_id' => $ID, 'number' => $tech_comment_num, 'type' => 'comment', 'status' => 'approve' ) );
- if ( $comment_array ) {
- $output .= '<ul class="comment-preview">';
- foreach ( $comment_array as $comment ) {
-
- $output .= '<li class="comments-link">';
- $output .= '<div class="comment-author">';
- $output .= '<a href="' . get_comment_link() . '" title="' . $comment->comment_author . __( ' posted on ', 'techozoic' ) . get_comment_date() . '">';
- $output .= $comment->comment_author . __( ' posted on ', 'techozoic' ) . get_comment_date();
- $output .= '</a>';
- $output .= '</div>';
- $output .= '<div class="comment-text">';
- $output .= get_comment_excerpt( $comment->comment_ID );
- $output .= '</div>';
- $output .= '</li>';
- }
- $output .= '</ul>';
- }
- print $output;
-}
if ( is_admin() && (isset( $_GET['page'] ) && $_GET['page'] == 'custom-header') && $pagenow == "themes.php" ) {
@@ -165,4 +165,41 @@ function techozoic_enqueue_comment_reply() {
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
+}
+
+/**
+ * Techozoic Home Page Comment Preview
+ *
+ * Comment preview section on home page. Pull comment excerpt for approved comments
+ * displays in an unordered list at bottom of each post.
+ *
+ * @param string $ID id of current post to pull comments for
+ *
+ * @access public
+ * @since 1.8.7
+ */
+
+function tech_comment_preview( $ID ) {
+ global $comment;
+ $tech_comment_num = of_get_option( 'comment_preview_num', '3' );
+ $output = "";
+ $comment_array = get_comments( array( 'post_id' => $ID, 'number' => $tech_comment_num, 'type' => 'comment', 'status' => 'approve' ) );
+ if ( $comment_array ) {
+ $output .= '<ul class="comment-preview">';
+ foreach ( $comment_array as $comment ) {
+
+ $output .= '<li class="comments-link">';
+ $output .= '<div class="comment-author">';
+ $output .= '<a href="' . get_comment_link() . '" title="' . $comment->comment_author . __( ' posted on ', 'techozoic' ) . get_comment_date() . '">';
+ $output .= $comment->comment_author . __( ' posted on ', 'techozoic' ) . get_comment_date();
+ $output .= '</a>';
+ $output .= '</div>';
+ $output .= '<div class="comment-text">';
+ $output .= get_comment_excerpt( $comment->comment_ID );
+ $output .= '</div>';
+ $output .= '</li>';
+ }
+ $output .= '</ul>';
+ }
+ print $output;
}
View
@@ -339,18 +339,15 @@ function tech_head_css() {
#dropdown li ul ul, .top-menu li ul ul{
left:{$tech_menu_width}px ;
}
-.post_date {
-background-color:{$tech_acc_color};
-}
.tags {
border-bottom:1px {$tech_acc_color} solid;
border-top:1px {$tech_acc_color} solid;
}
-a,h2 a:hover,h3 a:hover,.commentdiv a, .commentdiv a:visited,#user_login,#user_pass, .commentdiv span, #sidenav a:visited {
+a,h2 a:hover,h3 a:hover,#user_login,#user_pass, #sidenav a:visited {
color:{$tech_link_color};
text-decoration:none;
}
-.date_post,#searchform #s {
+#searchform #s {
color:{$tech_post_bg_color};
text-decoration:none;
}
@@ -8,10 +8,85 @@
* @author Jeremy Clark <jeremy@clark-technet.com>
* @copyright Copyright (c) 2011, Jeremy Clark
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
- * @since 1.0
+ * @since 2.1
*
*/
+/**
+ * Techozoic Social Media Icons Function
+ *
+ * Echos the social media icon links and images as set in options.
+ *
+ *
+ * @param bool $home whether the function called from home page or single page
+ *
+ * @access public
+ * @since 1.8.8
+ */
+
+function tech_social_icons( $home = true ) {
+ global $post;
+ $post_image = "";
+ if ( has_post_thumbnail( $post->ID ) ) {
+ $post_image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
+ $post_image = 'media=' . $post_image_array[0] . '&amp;';
+ }
+ $short_link = home_url() . "/?p=" . $post->ID;
+ $home_icons = of_get_option( 'home_social_icons', array( 'delicious' => '1', 'digg' => '1', 'rss' => '1' ) );
+ $single_icons = of_get_option( 'single_social_icons', array( 'delicious' => '1', 'digg' => '1', 'rss' => '1' ) );
+ $image = get_template_directory_uri() . "/images/icons";
+ $link = get_permalink();
+ $title = $post->post_title;
+ $email_title = preg_replace( '/&/i', 'and', $title );
+ $url_title = urlencode( $post->post_title );
+ $excerpt = urlencode( wp_trim_excerpt( $post->post_excerpt ) );
+ $excerpt_mail = wp_trim_excerpt( $post->post_excerpt );
+ $excerpt_mail = preg_replace( "/&#?[a-z0-9]{2,8};/i", "", $excerpt_mail );
+ $home_title = urlencode( get_bloginfo( 'name' ) );
+ $social_links = array(
+ "delicious" => "<a href='http://delicious.com/post?url={$link}&amp;title={$url_title}' title='" . __( 'del.icio.us this!', 'techozoic' ) . "' target='_blank' class='social delicious'></a>",
+ "digg" => "<a href='http://digg.com/submit?phase=2&amp;url={$link}&amp;title={$url_title}' title='" . __( 'Digg this!', 'techozoic' ) . "' target='_blank' class='social digg'></a>",
+ "email" => "<a href='mailto:?subject={$email_title}&amp;body={$excerpt_mail} {$link}' title='" . __( 'Share this by email.', 'techozoic' ) . "' class='social email'></a>",
+ "facebook" => "<a href='http://www.facebook.com/share.php?u={$link}&amp;t={$url_title}' title='" . __( 'Share on Facebook!', 'techozoic' ) . "' target='_blank' class='social facebook'></a>",
+ "linkedin" => "<a href ='http://www.linkedin.com/shareArticle?mini=true&amp;url={$link}&amp;title={$url_title}&amp;summary={$excerpt}&amp;source={$home_title}' title='" . __( 'Share on LinkedIn!', 'techozoic' ) . "' target='_blank' class='social linkedin'></a>",
+ "myspace" => "<a href='http://www.myspace.com/Modules/PostTo/Pages/?u={$link}&amp;t={$url_title}' title='" . __( 'Share on Myspace!', 'techozoic' ) . "' target='_blank' class='social myspace'></a>",
+ "newsvine" => "<a href='http://www.newsvine.com/_tools/seed&amp;save?u={$link}' title='" . __( 'Share on NewsVine!', 'techozoic' ) . "' target='_blank' class='social newsvine'></a>",
+ "stumbleupon" => "<a href='http://www.stumbleupon.com/submit?url={$link}&amp;title={$url_title}' title='" . __( 'Stumble Upon this!', 'techozoic' ) . "' target='_blank' class='social stumble'></a>",
+ "twitter" => "<a href='http://twitter.com/home?status=Reading%20{$url_title}%20on%20{$short_link}' title='" . __( 'Tweet this!', 'techozoic' ) . "' target='_blank' class='social twitter'></a>",
+ "reddit" => "<a href='http://reddit.com/submit?url={$link}&amp;title={$url_title}' title='" . __( 'Share on Reddit!', 'techozoic' ) . "' target='_blank' class='social reddit'></a>",
+ "rss" => "<a href='" . get_post_comments_feed_link() . "' title='" . __( 'Subscribe to Feed', 'techozoic' ) . "' class='social feed'></a>",
+ "pintrest" => "<a href='http://pinterest.com/pin/create/button/?url={$link}&amp;{$post_image}description={$excerpt}' class='pin-it-button' count-layout='none'><img src='//assets.pinterest.com/images/PinExt.png' title='Pin It' /></a>",
+ "google" => "<g:plusone size='small' annotation='none' expandto='right' href='$link'></g:plusone>" );
+ if ( $home == true ) {
+ if ( is_array( $home_icons ) ) {
+ foreach ( $home_icons as $key => $value ) {
+ if ( $value == "1" ) {
+ echo $social_links[$key] . "&nbsp;";
+ }
+ }
+ }
+ } else {
+ if ( is_array( $single_icons ) ) {
+ foreach ( $single_icons as $key => $value ) {
+ if ( $value == "1" ) {
+ echo $social_links[$key] . "&nbsp;";
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Techozoic Single Nav Links
+ *
+ * Echos the single nav links on single pages.
+ *
+ *
+ *
+ * @access public
+ * @since 2.1
+ */
+
function tech_single_nav_links() {
echo '<div class="navigation clear">';
if ( is_single() ) {
@@ -29,6 +104,17 @@ function tech_single_nav_links() {
echo '</div>';
}
+/**
+ * Techozoic Nav Links
+ *
+ * Echos the nav links on archive pages.
+ *
+ *
+ *
+ * @access public
+ * @since 2.1
+ */
+
function tech_nav_links() {
$prev_link = get_next_posts_link( __( '&laquo; Older Entries', 'techozoic' ) );
$next_link = get_previous_posts_link( __( 'Newer Entries &raquo;', 'techozoic' ) );
@@ -42,6 +128,16 @@ function tech_nav_links() {
echo '</div>';
}
+/**
+ * Techozoic Archive title
+ *
+ * Echos the title base on what archive user is currently browsing.
+ *
+ *
+ * @access public
+ * @since 2.1
+ */
+
function tech_archive_title() {
/* If this is a category archive */
if ( is_category() ) {
Oops, something went wrong.

0 comments on commit 52c9ff6

Please sign in to comment.