Skip to content
Newer
Older
100644 78 lines (51 sloc) 1.86 KB
03275de @splorp Added Starkers 2.8.5 theme files
authored May 27, 2010
1 <?php
2 /**
3 * @package WordPress
39f9af7 @splorp Added simple_post_class function to replace post_class verbosity
authored May 28, 2010
4 * @subpackage Simplicity
03275de @splorp Added Starkers 2.8.5 theme files
authored May 27, 2010
5 */
6
7 automatic_feed_links();
8
9 if ( function_exists('register_sidebar') ) {
10 register_sidebar(array(
11 'before_widget' => '<li id="%1$s" class="widget %2$s">',
12 'after_widget' => '</li>',
13 'before_title' => '<h2 class="widgettitle">',
14 'after_title' => '</h2>',
15 ));
16 }
39f9af7 @splorp Added simple_post_class function to replace post_class verbosity
authored May 28, 2010
17
18
19
20 // Replace default post class verbosity
21
22 function simple_post_class() {
23 $c[] = 'hentry';
24 return $c;
25 }
26
27 add_filter( 'post_class', 'simple_post_class' );
28
96f841c @splorp Added function to remove classes from page list items
authored May 30, 2010
29
30
6e99fba @splorp Added a proper thousands delimiter function for category post counts
authored Jun 2, 2010
31 // Add a proper thousands delimiter to category post counts
32
33 function delim($c) {
34 return preg_replace('/(\d)(\d{3})\b/','\1,\2',$c); // Hat tip to @myfonts for the regex tweaks
35 }
36
37 add_filter('wp_list_categories','delim');
38
39
40
9e2c930 @splorp The declass() function now handles <ul> elements and attributes wrapp…
authored Jun 1, 2010
41 // Remove extraneous class attributes from list elements
96f841c @splorp Added function to remove classes from page list items
authored May 31, 2010
42
43 function declass($c) {
9e2c930 @splorp The declass() function now handles <ul> elements and attributes wrapp…
authored Jun 1, 2010
44 $c_ = preg_replace('/<li class=[\"\'].+?[\"\']>/', '<li>', $c , -1); // Classes on list items
45 return preg_replace('/<ul class=[\"\'].+?[\"\']>/', '<ul>', $c_ , -1); // Classes on unordered list elements
96f841c @splorp Added function to remove classes from page list items
authored May 31, 2010
46
9e2c930 @splorp The declass() function now handles <ul> elements and attributes wrapp…
authored Jun 1, 2010
47 // Need to add handling of classes that occur after id elements
96f841c @splorp Added function to remove classes from page list items
authored May 31, 2010
48 }
49
50 add_filter('wp_list_pages','declass');
9e2c930 @splorp The declass() function now handles <ul> elements and attributes wrapp…
authored Jun 1, 2010
51 add_filter('wp_list_bookmarks','declass');
6e99fba @splorp Added a proper thousands delimiter function for category post counts
authored Jun 3, 2010
52 add_filter('wp_list_categories','declass');
53
96f841c @splorp Added function to remove classes from page list items
authored May 31, 2010
54
55
69a6344 @cdharrison Added functions to enable support of the_page_thumbnail within the RS…
cdharrison authored May 28, 2010
56 // Add support for the_post_thumbnail
96f841c @splorp Added function to remove classes from page list items
authored May 31, 2010
57
69a6344 @cdharrison Added functions to enable support of the_page_thumbnail within the RS…
cdharrison authored May 29, 2010
58 if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
59 add_theme_support( 'post-thumbnails' );
60 set_post_thumbnail_size( 600, 9999, true ); // Normal post thumbnails
61 add_image_size( 'archive-thumbnail', 50, 50 ); // Permalink thumbnail size
62 }
63
64 // Adds support for the_post_thumbnail in RSS feeds
65 function insertThumbnailRSS($content) {
66 global $post;
67 if ( has_post_thumbnail( $post->ID ) ){
68 $content = '<p class="image">' . get_the_post_thumbnail( $post->ID, 'medium' ) . '</p>' . $content;
69 }
70 return $content;
71 }
72
73 add_filter('the_excerpt_rss', 'insertThumbnailRSS');
74 add_filter('the_content_feed', 'insertThumbnailRSS');
75
76
39f9af7 @splorp Added simple_post_class function to replace post_class verbosity
authored May 28, 2010
77 ?>
Something went wrong with that request. Please try again.