Ticket #4517: 4517-bundle-sandbox-1.0.diff

File 4517-bundle-sandbox-1.0.diff, 220.5 kB (added by Speedboxer, 8 months ago)

Bundle Sandbox 1.0 and add it to wp-includes/theme.php as a bundled them

  • wp-content/themes/sandbox/footer.php

    old new  
     1 
     2        <div id="footer"> 
     3                <span id="generator-link"><a href="http://wordpress.org/" title="<?php _e('WordPress', 'sandbox'); ?>" rel="generator"><?php _e('WordPress', 'sandbox'); ?></a></span> 
     4                <span class="meta-sep">|</span> 
     5                <span id="theme-link"><a href="http://www.plaintxt.org/themes/sandbox/" title="<?php _e('Sandbox for WordPress', 'sandbox'); ?>" rel="designer"><?php _e('Sandbox', 'sandbox'); ?></a></span> 
     6        </div><!-- #footer --> 
     7 
     8</div><!-- #wrapper .hfeed --> 
     9 
     10<?php wp_footer() ?> 
     11 
     12</body> 
     13</html> 
  • wp-content/themes/sandbox/style.css

    old new  
     1/* 
     2THEME NAME: Sandbox 
     3THEME URI: http://www.plaintxt.org/themes/sandbox/ 
     4DESCRIPTION: A theme rich with powerful and dynamic semantic class selectors; a canvas for CSS artists 
     5VERSION: 1.0 
     6AUTHOR: <a href="http://andy.wordpress.com/">Andy Skelton</a> &amp; <a href="http://www.plaintxt.org/">Scott Allan Wallick</a> 
     7AUTHOR URI: 
     8*/ 
     9 
     10/* Two-column with sidebar on left from the /sandbox-layouts/ folder  */ 
     11@import url('sandbox-layouts/2c-l.css'); 
     12 
     13/* Just some example content */ 
     14div#header{text-align:center;margin-bottom:2em;} 
     15div#access div.skip-link{position:absolute;top:1em;right:1em;} 
     16div#menu{font-size:0.9em;height:1.5em;padding-top:0.3em;background:#eee;width:100%;} 
     17div#menu ul a{font-weight:700;text-decoration:none;} 
     18div#menu ul,div#menu ul ul,div#menu ul li{list-style:none;margin:0;padding:0;} 
     19div#menu ul li{float:left;} 
     20div#menu ul li a{background:#eee;padding:0.3em 0.5em;} 
     21div#menu ul ul{display:none;} 
     22div#menu ul ul li{float:none;} 
     23div#menu ul ul li a{margin:0;padding:0;} 
     24div#menu ul li:hover ul{display:block;font-size:0.9em;padding-top:0.5em;position:absolute;} 
     25div#menu ul li:hover ul li a{background:#f5f5f5;border:none;display:block;padding:0.1em;width:10em;} 
     26 
     27.entry-title{clear:both;} 
     28div#container,div.sidebar{margin-top:2em;} 
     29div#nav-above,div#nav-below{width:100%;height:1em;} 
     30div#nav-above{margin-bottom:1em;} 
     31div#nav-below{margin-top:1em;} 
     32.alignleft,div.nav-previous{float: left;} 
     33.alignright,div.nav-next{float: right;} 
     34form#commentform .form-label{margin:1em 0 0;} 
     35form#commentform span.required{background:#fff;color:red;} 
     36form#commentform,form#commentform p{padding:0;} 
     37input#author,input#email,input#url{width:50%;} 
     38input#author,input#email,input#url,textarea#comment{padding:0.2em;} 
     39div.comments ol li{margin:0 0 3.5em;} 
     40textarea#comment{height:13em;margin:0 0 0.5em;overflow:auto;width:66%;} 
     41 
     42div.sidebar div,div.sidebar h3,div.sidebar ul,div.sidebar li{margin:0;padding:0;} 
     43div.sidebar h3{font-size:1.2em;} 
     44div.sidebar input#s{width:7em;} 
     45div.sidebar li{list-style:none;margin:0 0 1em;} 
     46div.sidebar li form{margin:0.2em 0 0;padding:0;} 
     47div.sidebar ul ul{margin:0 0 0 1em;} 
     48div.sidebar ul ul li{list-style:disc;margin:0;} 
     49div.sidebar ul ul ul{margin:0 0 0 0.5em;} 
     50div.sidebar ul ul ul li{list-style:circle;} 
     51 
     52div#footer{text-align:center;} 
  • wp-content/themes/sandbox/author.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6<?php the_post() ?> 
     7 
     8                        <h2 class="page-title author"><?php printf(__('Author Archives: <span class="vcard">%s</span>', 'sandbox'), "<a class='url fn n' href='$authordata->user_url' title='$authordata->display_name' rel='me'>$authordata->display_name</a>") ?></h2> 
     9                        <div class="archive-meta"><?php if ( !(''== $authordata->user_description) ) : echo apply_filters('archive_meta', $authordata->user_description); endif; ?></div> 
     10 
     11                        <div id="nav-above" class="navigation"> 
     12                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     13                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     14                        </div> 
     15 
     16<?php rewind_posts(); while (have_posts()) : the_post(); ?> 
     17 
     18                        <div id="post-<?php the_ID(); ?>" class="<?php sandbox_post_class(); ?>"> 
     19                                <h3 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title(); ?></a></h3> 
     20                                <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></div> 
     21                                <div class="entry-content "> 
     22<?php the_excerpt(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').'') ?> 
     23 
     24                                </div> 
     25                                <div class="entry-meta"> 
     26                                        <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span> 
     27                                        <span class="meta-sep">|</span> 
     28                                        <?php the_tags(__('<span class="tag-links">Tagged ', 'sandbox'), ", ", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n") ?> 
     29<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n"); ?> 
     30                                        <span class="comments-link"><?php comments_popup_link(__('Comments (0)', 'sandbox'), __('Comments (1)', 'sandbox'), __('Comments (%)', 'sandbox')) ?></span> 
     31                                </div> 
     32                        </div><!-- .post --> 
     33 
     34<?php endwhile ?> 
     35 
     36                        <div id="nav-below" class="navigation"> 
     37                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     38                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     39                        </div> 
     40         
     41                </div><!-- #content --> 
     42        </div><!-- #container --> 
     43 
     44<?php get_sidebar() ?> 
     45<?php get_footer() ?> 
  • wp-content/themes/sandbox/archives.php

    old new  
     1<?php 
     2/* 
     3Template Name: Archives Page 
     4*/ 
     5?> 
     6<?php get_header() ?> 
     7         
     8        <div id="container"> 
     9                <div id="content"> 
     10 
     11<?php the_post() ?> 
     12 
     13                        <div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>"> 
     14                                <h2 class="entry-title"><?php the_title() ?></h2> 
     15                                <div class="entry-content"> 
     16<?php the_content(); ?> 
     17 
     18                                        <ul id="archives-page" class="xoxo"> 
     19                                                <li id="category-archives" class="content-column"> 
     20                                                        <h3><?php _e('Archives by Category', 'sandbox') ?></h3> 
     21                                                        <ul> 
     22                                                                <?php wp_list_cats('sort_column=name&optioncount=1&feed=RSS') ?>  
     23                                                        </ul> 
     24                                                </li> 
     25                                                <li id="monthly-archives" class="content-column"> 
     26                                                        <h3><?php _e('Archives by Month', 'sandbox') ?></h3> 
     27                                                        <ul> 
     28                                                                <?php wp_get_archives('type=monthly&show_post_count=1') ?> 
     29                                                        </ul> 
     30                                                </li> 
     31                                        </ul> 
     32<?php edit_post_link(__('Edit', 'sandbox'),'<span class="edit-link">','</span>') ?> 
     33 
     34                                </div> 
     35                        </div><!-- .post --> 
     36 
     37<?php if ( get_post_custom_values('comments') ) comments_template() // Add a key/value of "comments" to enable comments on pages! ?> 
     38 
     39                </div><!-- #content --> 
     40        </div><!-- #container --> 
     41 
     42<?php get_sidebar() ?> 
     43<?php get_footer() ?> 
  • wp-content/themes/sandbox/search.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6<?php if (have_posts()) : ?> 
     7 
     8                <h2 class="page-title"><?php _e('Search Results for:', 'sandbox') ?> <span id="search-terms"><?php echo wp_specialchars(stripslashes($_GET['s']), true); ?></span></h2> 
     9 
     10                        <div id="nav-above" class="navigation"> 
     11                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     12                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     13                        </div> 
     14 
     15<?php while ( have_posts() ) : the_post(); ?> 
     16 
     17                        <div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>"> 
     18                                <h3 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h3> 
     19                                <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></div> 
     20                                <div class="entry-content"> 
     21<?php the_excerpt(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').'') ?> 
     22 
     23                                </div> 
     24                                <div class="entry-meta"> 
     25                                        <span class="author vcard"><?php printf(__('By %s', 'sandbox'), '<a class="url fn n" href="'.get_author_link(false, $authordata->ID, $authordata->user_nicename).'" title="' . sprintf(__('View all posts by %s', 'sandbox'), $authordata->display_name) . '">'.get_the_author().'</a>') ?></span> 
     26                                        <span class="meta-sep">|</span> 
     27                                        <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span> 
     28                                        <span class="meta-sep">|</span> 
     29                                        <span class="tag-links"><?php the_tags(__('Tagged ', 'sandbox'), ', ') ?></span> 
     30                                        <span class="meta-sep">|</span> 
     31<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n"); ?> 
     32                                        <span class="comments-link"><?php comments_popup_link(__('Comments (0)', 'sandbox'), __('Comments (1)', 'sandbox'), __('Comments (%)', 'sandbox')) ?></span> 
     33                                </div> 
     34                        </div><!-- .post --> 
     35 
     36<?php endwhile; ?> 
     37 
     38                        <div id="nav-below" class="navigation"> 
     39                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     40                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     41                        </div> 
     42 
     43<?php else : ?> 
     44 
     45                        <div id="post-0" class="post noresults"> 
     46                                <h2 class="entry-title"><?php _e('Nothing Found', 'sandbox') ?></h2> 
     47                                <div class="entry-content"> 
     48                                        <p><?php _e('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'sandbox') ?></p> 
     49                                </div> 
     50                                <form id="noresults-searchform" method="get" action="<?php bloginfo('home') ?>"> 
     51                                        <div> 
     52                                                <input id="noresults-s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="40" /> 
     53                                                <input id="noresults-searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" /> 
     54                                        </div> 
     55                                </form> 
     56                        </div><!-- .post --> 
     57 
     58<?php endif; ?> 
     59 
     60                </div><!-- #content --> 
     61        </div><!-- #container --> 
     62 
     63<?php get_sidebar() ?> 
     64<?php get_footer() ?> 
  • wp-content/themes/sandbox/404.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6                        <div id="post-0" class="post error404"> 
     7                                <h2 class="entry-title"><?php _e('Not Found', 'sandbox') ?></h2> 
     8                                <div class="entry-content"> 
     9                                        <p><?php _e('Apologies, but we were unable to find what you were looking for. Perhaps  searching will help.', 'sandbox') ?></p> 
     10                                </div> 
     11                                <form id="error404-searchform" method="get" action="<?php bloginfo('home') ?>"> 
     12                                        <div> 
     13                                                <input id="error404-s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="40" /> 
     14                                                <input id="error404-searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" /> 
     15                                        </div> 
     16                                </form> 
     17                        </div><!-- .post --> 
     18 
     19                </div><!-- #content --> 
     20        </div><!-- #container --> 
     21 
     22<?php get_sidebar() ?> 
     23<?php get_footer() ?> 
  • wp-content/themes/sandbox/index.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6                        <div id="nav-above" class="navigation"> 
     7                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     8                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     9                        </div> 
     10 
     11<?php while ( have_posts() ) : the_post() ?> 
     12                        <div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>"> 
     13                                <h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h2> 
     14                                <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></div> 
     15                                <div class="entry-content"> 
     16<?php the_content(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').''); ?> 
     17 
     18<?php link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'sandbox'), "</div>\n", 'number'); ?> 
     19                                </div> 
     20                                <div class="entry-meta"> 
     21                                        <span class="author vcard"><?php printf(__('By %s', 'sandbox'), '<a class="url fn n" href="'.get_author_link(false, $authordata->ID, $authordata->user_nicename).'" title="' . sprintf(__('View all posts by %s', 'sandbox'), $authordata->display_name) . '">'.get_the_author().'</a>') ?></span> 
     22                                        <span class="meta-sep">|</span> 
     23                                        <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span> 
     24                                        <span class="meta-sep">|</span> 
     25                                        <?php the_tags(__('<span class="tag-links">Tagged ', 'sandbox'), ", ", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n") ?> 
     26<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n"); ?> 
     27                                        <span class="comments-link"><?php comments_popup_link(__('Comments (0)', 'sandbox'), __('Comments (1)', 'sandbox'), __('Comments (%)', 'sandbox')) ?></span> 
     28                                </div> 
     29                        </div><!-- .post --> 
     30 
     31<?php comments_template() ?> 
     32<?php endwhile ?> 
     33 
     34                        <div id="nav-below" class="navigation"> 
     35                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     36                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     37                        </div> 
     38 
     39                </div><!-- #content --> 
     40        </div><!-- #container --> 
     41 
     42<?php get_sidebar() ?> 
     43<?php get_footer() ?> 
  • wp-content/themes/sandbox/functions.php

    old new  
     1<?php 
     2// Produces a list of pages in the header without whitespace -- er, I mean negative space. 
     3function sandbox_globalnav() { 
     4        echo '<div id="menu"><ul>'; 
     5        $menu = wp_list_pages('title_li=&sort_column=menu_order&echo=0'); // Params for the page list in header.php 
     6        echo str_replace(array("\r", "\n", "\t"), '', $menu); 
     7        echo "</ul></div>\n"; 
     8} 
     9 
     10// Generates semantic classes for BODY element 
     11function sandbox_body_class( $print = true ) { 
     12        global $wp_query, $current_user; 
     13         
     14        // It's surely a WordPress blog, right? 
     15        $c = array('wordpress'); 
     16 
     17        // Applies the time- and date-based classes (below) to BODY element 
     18        sandbox_date_classes(time(), $c); 
     19 
     20        // Generic semantic classes for what type of content is displayed 
     21        is_home()       ? $c[] = 'home'       : null; 
     22        is_archive()    ? $c[] = 'archive'    : null; 
     23        is_date()       ? $c[] = 'date'       : null; 
     24        is_search()     ? $c[] = 'search'     : null; 
     25        is_paged()      ? $c[] = 'paged'      : null; 
     26        is_attachment() ? $c[] = 'attachment' : null; 
     27        is_404()        ? $c[] = 'four04'     : null; // CSS does not allow a digit as first character 
     28 
     29        // Special classes for BODY element when a single post 
     30        if ( is_single() ) { 
     31                $postID = $wp_query->post->ID; 
     32                the_post(); 
     33 
     34                // Adds 'single' class and class with the post ID 
     35                $c[] = 'single postid-' . $postID; 
     36 
     37                // Adds classes for the month, day, and hour when the post was published 
     38                if ( isset($wp_query->post->post_date) ) 
     39                        sandbox_date_classes(mysql2date('U', $wp_query->post->post_date), $c, 's-'); 
     40 
     41                // Adds category classes for each category on single posts 
     42                if ( $cats = get_the_category() ) 
     43                        foreach ( $cats as $cat ) 
     44                                $c[] = 's-category-' . $cat->slug; 
     45 
     46                // Adds tag classes for each tags on single posts 
     47                if ( $tags = get_the_tags() ) 
     48                        foreach ( $tags as $tag ) 
     49                                $c[] = 's-tag-' . $tag->slug; 
     50 
     51                // Adds MIME-specific classes for attachments 
     52                if ( is_attachment() ) { 
     53                        $the_mime = get_post_mime_type(); 
     54                        $boring_stuff = array("application/", "image/", "text/", "audio/", "video/", "music/"); 
     55                                $c[] = 'attachment-' . str_replace($boring_stuff, "", "$the_mime"); 
     56                } 
     57 
     58                // Adds author class for the post author 
     59                $c[] = 's-author-' . sanitize_title_with_dashes(strtolower(get_the_author('login'))); 
     60                rewind_posts(); 
     61        } 
     62 
     63        // Author name classes for BODY on author archives 
     64        else if ( is_author() ) { 
     65                $author = $wp_query->get_queried_object(); 
     66                $c[] = 'author'; 
     67                $c[] = 'author-' . $author->user_nicename; 
     68        } 
     69 
     70        // Category name classes for BODY on category archvies 
     71        else if ( is_category() ) { 
     72                $cat = $wp_query->get_queried_object(); 
     73                $c[] = 'category'; 
     74                $c[] = 'category-' . $cat->slug; 
     75        } 
     76 
     77        // Tag name classes for BODY on tag archives 
     78        else if ( is_tag() ) { 
     79                $tags = $wp_query->get_queried_object(); 
     80                $c[] = 'tag'; 
     81                $c[] = 'tag-' . $tags->slug; // Does not work; however I try to return the tag I get a false. Grrr. 
     82        } 
     83 
     84        // Page author for BODY on 'pages' 
     85        else if ( is_page() ) { 
     86                $pageID = $wp_query->post->ID; 
     87                the_post(); 
     88                $c[] = 'page pageid-' . $pageID; 
     89                $c[] = 'page-author-' . sanitize_title_with_dashes(strtolower(get_the_author('login'))); 
     90                rewind_posts(); 
     91        } 
     92 
     93        // For when a visitor is logged in while browsing 
     94        if ( $current_user->ID ) 
     95                $c[] = 'loggedin'; 
     96 
     97        // Paged classes; for 'page X' classes of index, single, etc. 
     98        if ( ( ( $page = $wp_query->get("paged") ) || ( $page = $wp_query->get("page") ) ) && $page > 1 ) { 
     99                $c[] = 'paged-'.$page.''; 
     100                if ( is_single() ) { 
     101                        $c[] = 'single-paged-'.$page.''; 
     102                } else if ( is_page() ) { 
     103                        $c[] = 'page-paged-'.$page.''; 
     104                } else if ( is_category() ) { 
     105                        $c[] = 'category-paged-'.$page.''; 
     106                } else if ( is_tag() ) { 
     107                        $c[] = 'tag-paged-'.$page.''; 
     108                } else if ( is_date() ) { 
     109                        $c[] = 'date-paged-'.$page.''; 
     110                } else if ( is_author() ) { 
     111                        $c[] = 'author-paged-'.$page.''; 
     112                } else if ( is_search() ) { 
     113                        $c[] = 'search-paged-'.$page.''; 
     114                } 
     115        } 
     116 
     117        // Separates classes with a single space, collates classes for BODY 
     118        $c = join(' ', apply_filters('body_class',  $c)); 
     119 
     120        // And tada! 
     121        return $print ? print($c) : $c; 
     122} 
     123 
     124// Generates semantic classes for each post DIV element 
     125function sandbox_post_class( $print = true ) { 
     126        global $post, $sandbox_post_alt; 
     127 
     128        // hentry for hAtom compliace, gets 'alt' for every other post DIV, describes the post type and p[n] 
     129        $c = array('hentry', "p$sandbox_post_alt", $post->post_type, $post->post_status); 
     130 
     131        // Author for the post queried 
     132        $c[] = 'author-' . sanitize_title_with_dashes(strtolower(get_the_author('login'))); 
     133 
     134        // Category for the post queried 
     135        foreach ( (array) get_the_category() as $cat ) 
     136                $c[] = 'category-' . $cat->slug; 
     137 
     138        // Tags for the post queried 
     139        foreach ( (array) get_the_tags() as $tag ) 
     140                $c[] = 'tag-' . $tag->slug; 
     141 
     142        // For password-protected posts 
     143        if ( $post->post_password ) 
     144                $c[] = 'protected'; 
     145 
     146        // Applies the time- and date-based classes (below) to post DIV 
     147        sandbox_date_classes(mysql2date('U', $post->post_date), $c); 
     148 
     149        // If it's the other to the every, then add 'alt' class 
     150        if ( ++$sandbox_post_alt % 2 ) 
     151                $c[] = 'alt'; 
     152 
     153        // Separates classes with a single space, collates classes for post DIV 
     154        $c = join(' ', apply_filters('post_class', $c)); 
     155 
     156        // And tada! 
     157        return $print ? print($c) : $c; 
     158} 
     159 
     160// Define the num val for 'alt' classes (in post DIV and comment LI) 
     161$sandbox_post_alt = 1; 
     162 
     163// Generates semantic classes for each comment LI element 
     164function sandbox_comment_class( $print = true ) { 
     165        global $comment, $post, $sandbox_comment_alt; 
     166 
     167        // Collects the comment type (comment, trackback), 
     168        $c = array($comment->comment_type); 
     169 
     170        // Counts trackbacks (t[n]) or comments (c[n]) 
     171        if ($comment->comment_type == 'trackback') { 
     172                $c[] = "t$sandbox_comment_alt"; 
     173        } else { 
     174                $c[] = "c$sandbox_comment_alt"; 
     175        } 
     176 
     177        // If the comment author has an id (registered), then print the log in name 
     178        if ( $comment->user_id > 0 ) { 
     179                $user = get_userdata($comment->user_id); 
     180 
     181                // For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]' 
     182                $c[] = "byuser comment-author-" . sanitize_title_with_dashes(strtolower($user->user_login)); 
     183                // For comment authors who are the author of the post 
     184                if ( $comment->user_id === $post->post_author ) 
     185                        $c[] = 'bypostauthor'; 
     186        } 
     187 
     188        // If it's the other to the every, then add 'alt' class; collects time- and date-based classes 
     189        sandbox_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); 
     190        if ( ++$sandbox_comment_alt % 2 ) 
     191                $c[] = 'alt'; 
     192 
     193        // Separates classes with a single space, collates classes for comment LI 
     194        $c = join(' ', apply_filters('comment_class', $c)); 
     195 
     196        // Tada again! 
     197        return $print ? print($c) : $c; 
     198} 
     199 
     200// Generates time- and date-based classes for BODY, post DIVs, and comment LIs; relative to GMT (UTC) 
     201function sandbox_date_classes($t, &$c, $p = '') { 
     202        $t = $t + (get_settings('gmt_offset') * 3600); 
     203        $c[] = $p . 'y' . gmdate('Y', $t); // Year 
     204        $c[] = $p . 'm' . gmdate('m', $t); // Month 
     205        $c[] = $p . 'd' . gmdate('d', $t); // Day 
     206        $c[] = $p . 'h' . gmdate('H', $t); // Hour 
     207} 
     208 
     209// For category lists on category archives: Returns other categories except the current one (redundant) 
     210function sandbox_cats_meow($glue) { 
     211        $current_cat = single_cat_title('', false); 
     212        $separator = "\n"; 
     213        $cats = explode($separator, get_the_category_list($separator)); 
     214 
     215        foreach ( $cats as $i => $str ) { 
     216                if ( strstr($str, ">$current_cat<") ) { 
     217                        unset($cats[$i]); 
     218                        break; 
     219                } 
     220        } 
     221 
     222        if ( empty($cats) ) 
     223                return false; 
     224 
     225        return trim(join($glue, $cats)); 
     226} 
     227 
     228// For tag lists on tag archives: Returns other tags except the current one (redundant) 
     229function sandbox_tag_ur_it($glue) { 
     230        $current_tag = single_tag_title('', '',  false); 
     231        $separator = "\n"; 
     232        $tags = explode($separator, get_the_tag_list("", "$separator", "")); 
     233 
     234        foreach ( $tags as $i => $str ) { 
     235                if ( strstr($str, ">$current_tag<") ) { 
     236                        unset($tags[$i]); 
     237                        break; 
     238                } 
     239        } 
     240 
     241        if ( empty($tags) ) 
     242                return false; 
     243 
     244        return trim(join($glue, $tags)); 
     245} 
     246 
     247 
     248// Widget: Search; to match the Sandbox style and replace Widget plugin default 
     249function widget_sandbox_search($args) { 
     250        extract($args); 
     251        if ( empty($title) ) 
     252                $title = __('Search', 'sandbox'); 
     253?> 
     254                <?php echo $before_widget ?> 
     255                        <?php echo $before_title ?><label for="s"><?php echo $title ?></label><?php echo $after_title ?> 
     256                        <form id="searchform" method="get" action="<?php bloginfo('home') ?>"> 
     257                                <div> 
     258                                        <input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="10" tabindex="1" /> 
     259                                        <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" tabindex="2" /> 
     260                                </div> 
     261                        </form> 
     262                <?php echo $after_widget ?> 
     263 
     264<?php 
     265} 
     266 
     267// Widget: Meta; to match the Sandbox style and replace Widget plugin default 
     268function widget_sandbox_meta($args) { 
     269        extract($args); 
     270        if ( empty($title) ) 
     271                $title = __('Meta', 'sandbox'); 
     272?> 
     273                <?php echo $before_widget; ?> 
     274                        <?php echo $before_title . $title . $after_title; ?> 
     275                        <ul> 
     276                                <?php wp_register() ?> 
     277                                <li><?php wp_loginout() ?></li> 
     278                                <?php wp_meta() ?> 
     279                        </ul> 
     280                <?php echo $after_widget; ?> 
     281<?php 
     282} 
     283 
     284// Widget: RSS links; to match the Sandbox style 
     285function widget_sandbox_rsslinks($args) { 
     286        extract($args); 
     287        $options = get_option('widget_sandbox_rsslinks'); 
     288        $title = empty($options['title']) ? __('RSS Links', 'sandbox') : $options['title']; 
     289?> 
     290                <?php echo $before_widget; ?> 
     291                        <?php echo $before_title . $title . $after_title; ?> 
     292                        <ul> 
     293                                <li><a href="<?php bloginfo('rss2_url') ?>" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> <?php _e('Posts RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All posts', 'sandbox') ?></a></li> 
     294                                <li><a href="<?php bloginfo('comments_rss2_url') ?>" title="<?php echo wp_specialchars(bloginfo('name'), 1) ?> <?php _e('Comments RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All comments', 'sandbox') ?></a></li> 
     295                        </ul> 
     296                <?php echo $after_widget; ?> 
     297<?php 
     298} 
     299 
     300// Widget: RSS links; element controls for customizing text within Widget plugin 
     301function widget_sandbox_rsslinks_control() { 
     302        $options = $newoptions = get_option('widget_sandbox_rsslinks'); 
     303        if ( $_POST["rsslinks-submit"] ) { 
     304                $newoptions['title'] = strip_tags(stripslashes($_POST["rsslinks-title"])); 
     305        } 
     306        if ( $options != $newoptions ) { 
     307                $options = $newoptions; 
     308                update_option('widget_sandbox_rsslinks', $options); 
     309        } 
     310        $title = htmlspecialchars($options['title'], ENT_QUOTES); 
     311?> 
     312                        <p><label for="rsslinks-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="rsslinks-title" name="rsslinks-title" type="text" value="<?php echo $title; ?>" /></label></p> 
     313                        <input type="hidden" id="rsslinks-submit" name="rsslinks-submit" value="1" /> 
     314<?php 
     315} 
     316 
     317// Widgets plugin: intializes the plugin after the widgets above have passed snuff 
     318function sandbox_widgets_init() { 
     319        if ( !function_exists('register_sidebars') ) 
     320                return; 
     321 
     322        // Uses H3-level headings with all widgets to match Sandbox style 
     323        $p = array( 
     324                'before_title' => "<h3 class='widgettitle'>", 
     325                'after_title' => "</h3>\n", 
     326        ); 
     327 
     328        // Table for how many? Two? This way, please. 
     329        register_sidebars(2, $p); 
     330 
     331        // Finished intializing Widgets plugin, now let's load the Sandbox default widgets 
     332        register_sidebar_widget(__('Search', 'sandbox'), 'widget_sandbox_search', null, 'search'); 
     333        unregister_widget_control('search'); 
     334        register_sidebar_widget(__('Meta', 'sandbox'), 'widget_sandbox_meta', null, 'meta'); 
     335        unregister_widget_control('meta'); 
     336        register_sidebar_widget(array(__('RSS Links', 'sandbox'), 'widgets'), 'widget_sandbox_rsslinks'); 
     337        register_widget_control(array(__('RSS Links', 'sandbox'), 'widgets'), 'widget_sandbox_rsslinks_control', 300, 90); 
     338} 
     339 
     340// Translate, if applicable 
     341load_theme_textdomain('sandbox'); 
     342 
     343// Runs our code at the end to check that everything needed has loaded 
     344add_action('init', 'sandbox_widgets_init'); 
     345 
     346// Adds filters so that things run smoothly 
     347add_filter('archive_meta', 'wptexturize'); 
     348add_filter('archive_meta', 'convert_smilies'); 
     349add_filter('archive_meta', 'convert_chars'); 
     350add_filter('archive_meta', 'wpautop'); 
     351 
     352// Remember: the Sandbox is for play. 
     353?> 
  • wp-content/themes/sandbox/sidebar.php

    old new  
     1        <div id="primary" class="sidebar"> 
     2                <ul class="xoxo"> 
     3<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : // begin primary sidebar widgets ?> 
     4 
     5                        <li id="pages"> 
     6                                <h3><?php _e('Pages', 'sandbox') ?></h3> 
     7                                <ul> 
     8<?php wp_list_pages('title_li=&sort_column=post_title' ) ?> 
     9                                </ul> 
     10                        </li> 
     11 
     12                        <li id="categories"> 
     13                                <h3><?php _e('Categories', 'sandbox'); ?></h3> 
     14                                <ul> 
     15<?php wp_list_categories('title_li=&show_count=0&hierarchical=1') ?>  
     16 
     17                                </ul> 
     18                        </li> 
     19 
     20                        <li id="archives"> 
     21                                <h3><?php _e('Archives', 'sandbox') ?></h3> 
     22                                <ul> 
     23<?php wp_get_archives('type=monthly') ?> 
     24 
     25                                </ul> 
     26                        </li> 
     27<?php endif; // end primary sidebar widgets  ?> 
     28                </ul> 
     29        </div><!-- #primary .sidebar --> 
     30 
     31        <div id="secondary" class="sidebar"> 
     32                <ul class="xoxo"> 
     33<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : // begin  secondary sidebar widgets ?> 
     34                        <li id="search"> 
     35                                <h3><label for="s"><?php _e('Search', 'sandbox') ?></label></h3> 
     36                                <form id="searchform" method="get" action="<?php bloginfo('home') ?>"> 
     37                                        <div> 
     38                                                <input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="10" tabindex="1" /> 
     39                                                <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" tabindex="2" /> 
     40                                        </div> 
     41                                </form> 
     42                        </li> 
     43 
     44<?php wp_list_bookmarks('title_before=<h3>&title_after=</h3>&show_images=1') ?> 
     45 
     46                        <li id="rss-links"> 
     47                                <h3><?php _e('RSS Feeds', 'sandbox') ?></h3> 
     48                                <ul> 
     49                                        <li><a href="<?php bloginfo('rss2_url') ?>" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> <?php _e('Posts RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All posts', 'sandbox') ?></a></li> 
     50                                        <li><a href="<?php bloginfo('comments_rss2_url') ?>" title="<?php echo wp_specialchars(bloginfo('name'), 1) ?> <?php _e('Comments RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All comments', 'sandbox') ?></a></li> 
     51                                </ul> 
     52                        </li> 
     53 
     54                        <li id="meta"> 
     55                                <h3><?php _e('Meta', 'sandbox') ?></h3> 
     56                                <ul> 
     57                                        <?php wp_register() ?> 
     58 
     59                                        <li><?php wp_loginout() ?></li> 
     60                                        <?php wp_meta() ?> 
     61 
     62                                </ul> 
     63                        </li> 
     64<?php endif; // end secondary sidebar widgets  ?> 
     65                </ul> 
     66        </div><!-- #secondary .sidebar --> 
  • wp-content/themes/sandbox/readme.html

    old new  
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     2<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" dir="ltr"> 
     3<head profile="http://gmpg.org/xfn/11"> 
     4        <title>The Sandbox &middot; An explanation</title> 
     5        <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
     6        <meta http-equiv="content-language" content="en-us" /> 
     7        <meta name="description" content="Sandbox: a highly semantic theme with powerful, dynamic class selectors" /> 
     8        <meta name="keywords" content="sandbox,xhtml,hatom,hcard,microformats,semantics,css,wordpress" /> 
     9        <style type="text/css" media="all"> 
     10        /*<![CDATA[*/ 
     11        body{background:#fcfcfc;color:#444;font:normal 70%/150% verdana,geneva,sans-serif;margin:0;padding:0;} 
     12        body blockquote{border-left:5px solid #f6f6f6;padding-left:0.5em;} 
     13        body code,body pre{font:1em/150% consolas,"courier new",courier,monospace;} 
     14        body div#readme{background:#fff;border-left:3px solid #f9f9f9;border-right:3px solid #f9f9f9;color:#444;margin:0 auto;padding:1em 2em;width:50em;} 
     15        body div#readme div#footer{margin:3em auto 1em;text-align:center;} 
     16        body div#readme div#footer p{background:#ffd;color:#666;display:inline;padding:0.2em 0.5em;} 
     17        body div#readme div#header{margin:0 auto;text-align:center;} 
     18        body div#readme div#header div.readme-version{font-size:0.9em;letter-spacing:0.1em;margin:0 0 0.5em;text-transform:uppercase;} 
     19        body h1{font-size:3.2em;} 
     20        body h1,body h2,body h3{font-family:garamond,georgia,times,serif;font-weight:400;} 
     21        body h2{font-size:2em;margin-top:3em;} 
     22        body h3{font-size:1.6em;margin-top:2em;} 
     23        body ol li ol li,body ol li#features ol li ol li{list-style:decimal;} 
     24        body ol li#functions h3{font-size:1.5em;} 
     25        body ol li#functions ol{list-style:lower-alpha;margin:0 0 0 2em;padding:0;} 
     26        body ol li#license blockquote a{color:#222;text-decoration:none;} 
     27        body ol li#license blockquote strong{font-size:0.9em;font-weight:400;text-transform:uppercase;} 
     28        body ol li,body ol#menu li ol li{list-style:upper-roman;} 
     29        body ol ul li{list-style:square;} 
     30        body ol#menu li{list-style:none;} 
     31        body ol#menu li ol li ol li,body ol li#functions ol li,body ol li#features ol li{list-style:lower-roman;} 
     32        body pre span,body span.bold{font-weight:700;} 
     33        body span.vcard span.family-name,body span.vcard span.additional-name{display:none;} 
     34        table{border-collapse:separate;border-color:#aaa;border-spacing:0;border-style:solid;border-width:1px;padding:0 0.5em;} 
     35        table tbody td{border-collapse:separate;border-color:#aaa;border-style:solid;border-width:0.5px 0;padding:0.2em 0.5em;} 
     36        table tbody th{border-bottom:1px solid #aaa;font-size:0.8em;text-align:left;text-transform:uppercase;} 
     37        table tbody tr.alt{background:#f5f5f5;} 
     38        table tfoot th{font-size:0.8em;padding-top:1em;text-align:left;text-transform:uppercase;} 
     39        table thead th{padding:0.5em;} 
     40        /*]]>*/ 
     41        </style> 
     42</head> 
     43<body> 
     44        <div id="readme"> 
     45                <div id="header"> 
     46                        <h1 id="title">The Sandbox</h1> 
     47                        <div class="readme-version">Version 1.0</div> 
     48                        <div class="readme-subtitle">A theme rich and powerful with dynamic semantic class selectors</div> 
     49                </div><!-- #header --> 
     50                <ol id="menu" class="xoxo"> 
     51                        <li> 
     52                                <h2>Table of contents</h2> 
     53                                <ol> 
     54                                        <li><a href="#introduction" title="Skip to Introduction">Introduction</a></li> 
     55                                        <li><a href="#installing" title="Skip to Installing">Installing</a></li> 
     56                                        <li><a href="#started" title="Skip to Getting started">Getting started</a></li> 
     57                                        <li><a href="#functions" title="Skip to Class functions">Class functions</a> 
     58                                                <ol> 
     59                                                        <li><a href="#body-class" title="Skip to Class functions: sandbox_body_class()"><code>sandbox_body_class()</code></a></li> 
     60                                                        <li><a href="#post-class" title="