"; if ( !is_front_page() ) { ?>
  • \n"; } // Produces an hCard for the "admin" user function barthelme_admin_hCard() { global $wpdb, $user_info; $user_info = get_userdata(1); echo '' . $user_info->first_name . ' ' . $user_info->last_name . ''; } // Produces an hCard for post authors function barthelme_author_hCard() { global $wpdb, $authordata; echo '' . get_the_author() . ''; } function barthelme_body_class( $print = true ) { global $wp_query, $current_user; $c = array('wordpress'); barthelme_date_classes(time(), $c); is_home() ? $c[] = 'home' : null; is_archive() ? $c[] = 'archive' : null; is_date() ? $c[] = 'date' : null; is_search() ? $c[] = 'search' : null; is_paged() ? $c[] = 'paged' : null; is_attachment() ? $c[] = 'attachment' : null; is_404() ? $c[] = 'four04' : null; if ( is_single() ) { the_post(); $c[] = 'single'; if ( isset($wp_query->post->post_date) ) barthelme_date_classes(mysql2date('U', $wp_query->post->post_date), $c, 's-'); foreach ( (array) get_the_category() as $cat ) $c[] = 's-category-' . $cat->category_nicename; $c[] = 's-author-' . get_the_author_login(); rewind_posts(); } elseif ( is_author() ) { $author = $wp_query->get_queried_object(); $c[] = 'author'; $c[] = 'author-' . $author->user_nicename; } elseif ( is_category() ) { $cat = $wp_query->get_queried_object(); $c[] = 'category'; $c[] = 'category-' . $cat->category_nicename; } elseif ( is_page() ) { the_post(); $c[] = 'page'; $c[] = 'page-author-' . get_the_author_login(); rewind_posts(); } if ( $current_user->ID ) $c[] = 'loggedin'; $c = join(' ', apply_filters('body_class', $c)); return $print ? print($c) : $c; } // Produces semantic classes for the each individual post div; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function barthelme_post_class( $print = true ) { global $post, $barthelme_post_alt; $c = array('hentry', "p$barthelme_post_alt", $post->post_type, $post->post_status); $c[] = 'author-' . get_the_author_login(); if ( is_attachment() ) $c[] = 'attachment'; foreach ( (array) get_the_category() as $cat ) $c[] = 'category-' . $cat->category_nicename; barthelme_date_classes(mysql2date('U', $post->post_date), $c); if ( ++$barthelme_post_alt % 2 ) $c[] = 'alt'; $c = join(' ', apply_filters('post_class', $c)); return $print ? print($c) : $c; } $barthelme_post_alt = 1; // Produces semantic classes for the each individual comment li; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function barthelme_comment_class( $print = true ) { global $comment, $post, $barthelme_comment_alt; $c = array($comment->comment_type); if ( $comment->user_id > 0 ) { $user = get_userdata($comment->user_id); $c[] = "byuser commentauthor-$user->user_login"; if ( $comment->user_id === $post->post_author ) $c[] = 'bypostauthor'; } barthelme_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); if ( ++$barthelme_comment_alt % 2 ) $c[] = 'alt'; $c[] = "c$barthelme_comment_alt"; $c = join(' ', apply_filters('comment_class', $c)); return $print ? print($c) : $c; } // Produces date-based classes for the three functions above; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function barthelme_date_classes($t, &$c, $p = '') { $t = $t + (get_option('gmt_offset') * 3600); $c[] = $p . 'y' . gmdate('Y', $t); $c[] = $p . 'm' . gmdate('m', $t); $c[] = $p . 'd' . gmdate('d', $t); $c[] = $p . 'h' . gmdate('h', $t); } // Returns other categories except the current one (redundant); Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function barthelme_other_cats($glue) { $current_cat = single_cat_title('', false); $separator = "\n"; $cats = explode($separator, get_the_category_list($separator)); foreach ( $cats as $i => $str ) { if ( strstr($str, ">$current_cat<") ) { unset($cats[$i]); break; } } if ( empty($cats) ) return false; return trim(join($glue, $cats)); } // Returns other tags except the current one (redundant); Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function barthelme_other_tags($glue) { $current_tag = single_tag_title('', '', false); $separator = "\n"; $tags = explode($separator, get_the_tag_list("", "$separator", "")); foreach ( $tags as $i => $str ) { if ( strstr($str, ">$current_tag<") ) { unset($tags[$i]); break; } } if ( empty($tags) ) return false; return trim(join($glue, $tags)); } // Produces an avatar image with the hCard-compliant photo class function barthelme_commenter_link() { $commenter = get_comment_author_link(); if ( ereg( ']* class=[^>]+>', $commenter ) ) { $commenter = ereg_replace( '(]* class=[\'"]?)', '\\1url ' , $commenter ); } else { $commenter = ereg_replace( '(' . $commenter . ''; } // Function to filter the default gallery shortcode function barthelme_gallery($attr) { global $post; if ( isset($attr['orderby']) ) { $attr['orderby'] = sanitize_sql_orderby($attr['orderby']); if ( !$attr['orderby'] ) unset($attr['orderby']); } extract(shortcode_atts( array( 'orderby' => 'menu_order ASC, ID ASC', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', ), $attr )); $id = intval($id); $orderby = addslashes($orderby); $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby={$orderby}"); if ( empty($attachments) ) return null; if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $id => $attachment ) $output .= wp_get_attachment_link( $id, $size, true ) . "\n"; return $output; } $listtag = tag_escape($listtag); $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $output = apply_filters( 'gallery_style', "\n" . '
    ', 9 ); // Available filter: gallery_style foreach ( $attachments as $id => $attachment ) { $img_lnk = get_attachment_link($id); $img_src = wp_get_attachment_image_src( $id, $size ); $img_src = $img_src[0]; $img_alt = $attachment->post_excerpt; if ( $img_alt == null ) $img_alt = $attachment->post_title; $img_rel = apply_filters( 'gallery_img_rel', 'attachment' ); // Available filter: gallery_img_rel $img_class = apply_filters( 'gallery_img_class', 'gallery-image' ); // Available filter: gallery_img_class $output .= "\n\t" . '<' . $itemtag . ' class="gallery-item gallery-columns-' . $columns .'">'; $output .= "\n\t\t" . '<' . $icontag . ' class="gallery-icon">' . $img_alt . ''; if ( $captiontag && trim($attachment->post_excerpt) ) { $output .= "\n\t\t" . '<' . $captiontag . ' class="gallery-caption">' . $attachment->post_excerpt . ''; } $output .= "\n\t" . ''; if ( $columns > 0 && ++$i % $columns == 0 ) $output .= "\n
    \n" . '
    '; } $output .= "\n
    \n"; return $output; } // Loads a Barthelme-style Search widget function widget_barthelme_search($args) { extract($args); $options = get_option('widget_barthelme_search'); $title = empty($options['title']) ? __( 'Search', 'barthelme' ) : $options['title']; $button = empty($options['button']) ? __( 'Find', 'barthelme' ) : $options['button']; ?>

    except the home.', 'barthelme'); ?>

    "

    ", 'after_title' => "

    \n", ); register_sidebars(1, $p); // Finished intializing Widgets plugin, now let's load the Barthelme default widgets; first, Barthelme search widget $widget_ops = array( 'classname' => 'widget_search', 'description' => __( "A search form for your blog (Barthelme)", "barthelme" ) ); wp_register_sidebar_widget( 'search', __( 'Search', 'barthelme' ), 'widget_barthelme_search', $widget_ops ); unregister_widget_control('search'); wp_register_widget_control( 'search', __( 'Search', 'barthelme' ), 'widget_barthelme_search_control' ); // Barthelme Meta widget $widget_ops = array( 'classname' => 'widget_meta', 'description' => __( "Log in/out and administration links (Barthelme)", "barthelme" ) ); wp_register_sidebar_widget( 'meta', __( 'Meta', 'barthelme' ), 'widget_barthelme_meta', $widget_ops ); unregister_widget_control('meta'); wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' ); //Barthelme Home Link widget $widget_ops = array( 'classname' => 'widget_home_link', 'description' => __( "Link to the front page when elsewhere (Barthelme)", "barthelme" ) ); wp_register_sidebar_widget( 'home_link', __( 'Home Link', 'barthelme' ), 'widget_barthelme_homelink', $widget_ops ); wp_register_widget_control( 'home_link', __( 'Home Link', 'barthelme' ), 'widget_barthelme_homelink_control' ); //Barthelme RSS Links widget $widget_ops = array( 'classname' => 'widget_rss_links', 'description' => __( "RSS links for both posts and comments (Barthelme)", "barthelme" ) ); wp_register_sidebar_widget( 'rss_links', __( 'RSS Links', 'barthelme' ), 'widget_barthelme_rsslinks', $widget_ops ); wp_register_widget_control( 'rss_links', __( 'RSS Links', 'barthelme' ), 'widget_barthelme_rsslinks_control' ); } // Loads the admin menu; sets default settings for each function barthelme_add_admin() { if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { check_admin_referer('barthelme_save_options'); update_option( 'barthelme_authorlink', strip_tags( stripslashes( $_REQUEST['bm_authorlink'] ) ) ); // Option for the author link update_option( 'barthelme_basefontfamily', strip_tags( stripslashes( $_REQUEST['bm_basefontfamily'] ) ) ); // Base font family update_option( 'barthelme_basefontsize', strip_tags( stripslashes( $_REQUEST['bm_basefontsize'] ) ) ); // Base font size update_option( 'barthelme_headerfontcolor', strip_tags( stripslashes( $_REQUEST['bm_headerfontcolor'] ) ) ); // Color for the header text update_option( 'barthelme_headingfontfamily', strip_tags( stripslashes( $_REQUEST['bm_headingfontfamily'] ) ) ); // Heading font family update_option( 'barthelme_layoutwidth', strip_tags( stripslashes( $_REQUEST['bm_layoutwidth'] ) ) ); // Layout width update_option( 'barthelme_lowercolor', strip_tags( stripslashes( $_REQUEST['bm_lowercolor'] ) ) ); // Lower color for the header image gradiant update_option( 'barthelme_posttextalignment', strip_tags( stripslashes( $_REQUEST['bm_posttextalignment'] ) ) ); // Post text alignment update_option( 'barthelme_uppercolor', strip_tags( stripslashes( $_REQUEST['bm_uppercolor'] ) ) ); // Upper color for the header image gradiant update_option( 'barthelme_avatarsize', strip_tags( stripslashes( $_REQUEST['bm_avatarsize'] ) ) ); // Avatar size header("Location: themes.php?page=functions.php&saved=true"); die; } elseif ( 'reset' == $_REQUEST['action'] ) { check_admin_referer('barthelme_reset_options'); delete_option('barthelme_authorlink'); delete_option('barthelme_basefontfamily'); delete_option('barthelme_basefontsize'); delete_option('barthelme_headerfontcolor'); delete_option('barthelme_headingfontfamily'); delete_option('barthelme_layoutwidth'); delete_option('barthelme_lowercolor'); delete_option('barthelme_posttextalignment'); delete_option('barthelme_uppercolor'); delete_option('barthelme_avatarsize'); header("Location: themes.php?page=functions.php&reset=true"); die; } add_action('admin_head', 'barthelme_admin_head'); } add_theme_page( __( 'Barthelme Theme Options', 'barthelme' ), __( 'Theme Options', 'barthelme' ), 'edit_themes', basename(__FILE__), 'barthelme_admin' ); } function barthelme_donate() { $form = '
    Donate with PayPal
    ' . "\n\t"; echo $form; } function barthelme_admin_head() { // Additional CSS styles for the theme options menu ?>

    View site.', 'barthelme'), get_bloginfo('home') . '/'); ?>

    Thanks for selecting the Barthelme theme by Scott Allan Wallick. Please read the included documentation for more information about the Barthelme and its advanced features. If you find this theme useful, please consider . You must click on Save Options to save any changes. You can also discard your changes and reload the default settings by clicking on Reset.

    ', 'barthelme'), barthelme_donate(), get_template_directory_uri() . '/readme.html' ); ?>

    " tabindex="1" size="10" />

    75%.', 'barthelme'); ?>

    tabindex="2" />
    tabindex="3" />
    tabindex="4" />
    tabindex="5" />
    tabindex="6" />
    tabindex="7" />
    tabindex="8" />
    tabindex="9" />
    tabindex="10" />

    Arial.', 'barthelme'), 'web safe'); ?>

    tabindex="11" />
    tabindex="12" />
    tabindex="13" />
    tabindex="14" />
    tabindex="15" />
    tabindex="16" />
    tabindex="17" />
    tabindex="18" />
    tabindex="19" />

    Georgia. ', 'barthelme'), 'web safe'); ?>

    " tabindex="20" size="10" />

    auto.', 'barthelme'); ?>

    Note: If you use 100%, the width will be ever-so-larger than the browser window. If you want to play, I suggest playing with ems. But really, auto is the best option.', 'barthelme'); ?>

    left.', 'barthelme'); ?>

    documentation for info). Default is displayed.', 'barthelme'); ?>

    " size="6" />

    32.', 'barthelme'); ?>

    hexidecimal color value without the "#" symbol for each color value. Otherwise, things won\'t work.', 'barthelme'); ?>

    # " tabindex="23" size="10" />

    8999B0.', 'barthelme'); ?>

    # " tabindex="24" size="10" />

    BBC8D9.', 'barthelme'); ?>

    # " tabindex="25" size="10" />

    FEFEFE.', 'barthelme'); ?>

    Save Options. A reset does not affect the actual theme files in any way. If you are uninstalling Barthelme, please reset before removing the theme files to clear your databse.', 'barthelme'); ?>

    ' . get_the_author() . ''; } else { echo '' . get_the_author() . ''; } } elseif ( get_option('barthelme_authorlink') =="displayed" ) { if ( is_single() || is_page() ) { return '' . get_the_author() . ''; } else { echo '' . get_the_author() . ''; } } elseif ( get_option('barthelme_authorlink') =="hidden" ) { if ( is_single() || is_page() ) { return '' . get_the_author() . ''; } else { echo ''; } }; } if ( get_option('barthelme_basefontsize') == "" ) { $basefontsize = '75%'; } else { $basefontsize = attribute_escape( stripslashes( get_option('barthelme_basefontsize') ) ); }; if ( get_option('barthelme_basefontfamily') == "" ) { $basefontfamily = 'arial,helvtica,sans-serif'; } else { $basefontfamily = wp_specialchars( stripslashes( get_option('barthelme_basefontfamily') ) ); }; if ( get_option('barthelme_headingfontfamily') == "" ) { $headingfontfamily = 'georgia,times,serif'; } else { $headingfontfamily = wp_specialchars( stripslashes( get_option('barthelme_headingfontfamily') ) ); }; if ( get_option('barthelme_layoutwidth') == "" ) { $layoutwidth = 'auto'; } else { $layoutwidth = attribute_escape( stripslashes( get_option('barthelme_layoutwidth') ) ); }; if ( get_option('barthelme_posttextalignment') == "" ) { $posttextalignment = 'left'; } else { $posttextalignment = attribute_escape( stripslashes( get_option('barthelme_posttextalignment') ) ); }; if ( get_option('barthelme_uppercolor') == "" ) { $uppercolor = '8a9aae'; } else { $uppercolor = attribute_escape( stripslashes( get_option('barthelme_uppercolor') ) ); }; if ( get_option('barthelme_lowercolor') == "" ) { $lowercolor = 'bac8da'; } else { $lowercolor = attribute_escape( stripslashes( get_option('barthelme_lowercolor') ) ); }; if ( get_option('barthelme_headerfontcolor') == "" ) { $headerfontcolor = 'fefefe'; } else { $headerfontcolor = attribute_escape(stripslashes(get_option('barthelme_headerfontcolor'))); }; ?>