__('Sidebar', 'monospaced'), 'id' => 'sidebar' ); register_sidebar($args); $args = array( 'name' => __('Footer', 'monospaced'), 'id' => 'footer' ); register_sidebar($args); function monospace_meta () { global $post; ?>
   
= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'monospace' ), max( $paged, $page ) ); } function monospace_navigation () { ?>
  ID)); $title = urlencode(get_the_title()); ?> Twitter  Facebook  Google Reader  Ping.fm
ID){return;} $now = current_time('mysql', 1); $tags = wp_get_post_tags($post->ID); $tagcount = count($tags); $taglist = ''; if ($tagcount) $taglist = "'" . $tags[0]->term_id. "'"; if ($tagcount > 1) { for ($i = 1; $i < $tagcount; $i++) { $taglist = $taglist . ", '" . $tags[$i]->term_id . "'"; } } if ($taglist) $taglist = "AND (t_t.term_id IN ($taglist))"; $q = " SELECT p.ID, p.post_title, p.post_content,p.post_excerpt, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM $wpdb->term_taxonomy t_t, $wpdb->term_relationships t_r, $wpdb->posts p WHERE 1 AND t_t.taxonomy ='post_tag' AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND p.ID != $post->ID AND p.post_status = 'publish' AND p.post_date_gmt < '$now' $taglist GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5; "; $related_posts = $wpdb->get_results($q); if (!$related_posts) { $q = " SELECT ID, post_title, post_content, post_excerpt, post_date,comment_count FROM $wpdb->posts WHERE 1 AND post_status = 'publish' AND post_type = 'post' AND ID != $post->ID ORDER BY RAND() LIMIT 5 "; $related_posts = $wpdb->get_results($q); } $i = 0; $output = ''; foreach ($related_posts as $related_post ){ $datestr = strtotime($related_post->post_date); $dm = date('d/m', $datestr); $y = substr(date('Y', $datestr),2,2); $output .= '
  • '.wptexturize($related_post->post_title).'
  • '; } if (!$output) return false; else echo ''; } add_filter('comment_class','comment_add_microid'); function comment_add_microid($classes) { $c_email=get_comment_author_email(); $c_url=get_comment_author_url(); if (!empty($c_email) && !empty($c_url)) { $microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:'.$c_email).sha1($c_url)); $classes[] = $microid; } return $classes; } ?>