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

File 4517-bundle-sandbox-1.2.diff, 220.6 kB (added by kalgriffen, 6 months ago)

Include Sandbox 1.2 as a bundled theme and add it to wp-includes/theme.php. Note: the screenshot.png will have to be added manually.

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