sandbox-playpen
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:A fork of the popular Sandbox theme for WordPress, designed to be leaner and more streamlined with WP2.8+



	The Sandbox · An explanation
	
	
	
	
	


	
  1. Introduction

    Sandbox is a lot of things:

    • For WordPress 2.6.x
    • Beautiful on the inside
    • Valid XHTML 1.0 Transitional
    • Widgets friendly
    • The basis for your GPL-licensed theme

    More importantly, the Sandbox can be a lot of things.

    What began as Scott Allan Wallick's leftovers has become an advanced, semantics-based theme. Andy Skelton added his innovative semantic class-generating functions and Scott edited it to oblivion.

    So what can you do with the Sandbox?

    • You can just use it as-is and have a super-cool, truly minimalist theme.
    • You can thoroughly customize it with CSS alone.
    • You can use its functions, files, et al, as pleases you.
    • You can use it to learn a few things about CSS, XHTML, and PHP.

    The real feature of the Sandbox is its markup. The use of class-generating functions in the body, post div, and comment/trackback li elements create an exceptionally extensible foundation. As Andy said, Given straightforward markup with plenty of selectors, there isn't much that can't be accomplished with CSS and a decent browser.

    And the implementation of the hAtom and hCard microformats means we're looking forward. You might be able to improve on our markup, but who wants to work that hard?

  2. Installing

    The Sandbox theme is installed just like any other WordPress theme. To install this theme:

    1. Download the latest Sandbox release
    2. Extract the /sandbox/ folder from the archive
    3. Upload it to the ../wp-contents/themes/ directory
    4. Activate the theme in the Design submenu
    5. Enjoy

    You can read more detailed installation instructions on the WordPress Codex.

    Subversion Access

    Developers interested in Subversion access to the Sandbox repository may visit code.google.com/p/sandbox-theme. Please ignore if unfamiliar with Subversion.

    For the latest and possibly unstable version, check out the /trunk/:

    svn checkout http://sandbox-theme.googlecode.com/svn/trunk/

    A legacy version for WordPress 2.0.x is in /branches/0.9/. Otherwise, please check out tagged versions in the /tags/ subdirectory. Tagged versions are stable and the latest release will be for the current stable version of WordPress.

  3. Getting started

    For beginners getting started, see the example layouts in /sandbox-layouts/. Instructions for using the included layouts can be found in the folder.

    The simplest way to get started with the Sandbox is to jump right in to style.css, using CSS to design the appearence of the Sandbox.

    For help learning CSS, visit:

    For Sandbox-related resources, including how-tos, Sandbox-based theme templates, and more, visit:

    If you are interested in developing theme templates based on the Sandbox, see Creating theme templates in this document.

  4. Other features

    In addition to the more advanced, code-related features of the Sandbox, there are at least two other features that make the Sandbox a highly viable choice as a base theme.

    1. Comments on pages

      Comments are not displayed on pages by default, but are displayed on posts, per the current convention. You can enable comments on a per page basis by adding a custom key/value with only the text comments.

      To enable comments on a page:

      1. In the Write › Page menu, expand the Custom Fields box
      2. In the Custom Fields box, add a new key with the exact text comments
      3. Add any text for a value (some text must be included for the key to save)
      4. Click Add Custom Field to save the key/value
      5. Comments should now be enabled on that page

      Enabling comments simply includes the comments.php file with the page. You can turn off comments on a page by deleting the comments key/value. This does not delete any exisiting comments, but simply disables comments.php from loading with the page.

    2. Page templates

      There are two page templates included: Links Page (links.php) and Archives Page (archives.php). You can add a title, text, and enable comments (see above) with both of these page templates.

      To use the page templates:

      1. In the Write › Page menu, expand the Page Templates box
      2. From the drop-down, select the page template to use
      3. Add a title and text (optional) for the page
      4. Click Create New Page / Save to publish the page

      The Archive Page template displays archives by month and by category. The Links Page displays links by link category.

  5. Creating a theme template

    If you are interested in creating a design for public release, consider creating a theme template based on the Sandbox. First read Designing Themes for Public Release on the WordPress Codex and seek support on the WordPress.org Forums.

    A theme template is a WordPress theme that uses the PHP files, e.g., index.php, single.php, in another theme folder but the style.css of the theme template.

    For a collection of excellent theme templates designed for the Sandbox, visit the Sandbox Designs Competition. In 2007, there were 46 designs submitted in the competition. All are examples of theme templates based on the Sandbox.

    Creating a theme template is essentially the same as creating a regular theme for WordPress, except you are not modifying any of the theme files and instead providing an alternate style.css.

    /*
    THEME NAME: My Design
    THEME URI: http://www.example.com/my-design/
    DESCRIPTION: New curtains for an old room
    VERSION: 0.1
    AUTHOR: John Doe
    AUTHOR Uri: http://www.example.com
    TAGS: one column, two columns, three columns, awesome, blue, pink
    TEMPLATE: sandbox
    */

    The line TEMPLATE: sandbox tells WordPress to use the theme files installed in the /sandbox/ folder with the "My Design" style.css style sheet.

    You can read more detailed information about developing WordPress Theme Style Sheets or in Creating Sandbox-based theme templates in the Sandbox Forums.

  6. Using filters

    Filters allow plugins and theme templates to change the data that the Sandbox returns to the browser without having to alter the theme fiiles. Filters provide a simple, clean way of altering what the Sandbox does without modifying the actual theme files.

    For example, if you wanted to add a link to globalnav page list, you would have to edit the theme files. When you upgrade the theme files (or accidentally break something), you will have to go back and make this change again. By using the globalnav_menu filter, however, you can alter the output of the sandbox_globalnav() without changing a single theme file.

    The chart below lists the filters available in the Sandbox theme.

    Sandbox filters
    Filter examples
    // Sandbox produces 32px avatars -- too small!
    function make_avatars_big() {
    	return '64';
    }
    // Add our function to the filter in Sandbox
    add_filter( 'avatar_size', 'make_avatars_big' );
    Filter Reference Usage
    avatar_size functions.php, 280 Sets avatar image dimenions in pixels
    body_class functions.php, 143 Adds classes to the body element
    comment_class functions.php, 222 Adds classes to a comment li element
    gallery_img_class functions.php, 280 Adds classes to gallery images
    gallery_img_rel functions.php, 334 Adds rel attributes to gallery images
    globalnav_menu functions.php, 23 Echos list of pages without white space
    post_class functions.php, 183 Adds classes to a post div element

    For more information on using filters, see Plugin API: Filters on the WordPress Codex. The initial discussion about filters in the Sandbox on the Sandbox Forums may be also useful.

  7. Translations

    The Sandbox allows for complete localization. For detailed information about translating the Sandbox into your language, see Sandbox in your language on the Sandbox wiki.

    If you would like to submit a translation for the Sandbox, please open a new issue on the Sandbox project home. Please include both the PO and MO files. You're also welcome to help edit existing translations.

    Translations have been graciously provided by the following individuals:

  8. Web standards

    The Sandbox is compliant with both XHTML and CSS standards. What does this mean? An explanation of web standards from The Web Standards Project:

    Complying with web standards can give your web pages greater visibility in web searches. The structural information present in compliant documents makes it easy for search engines to access and evaluate the information in those documents, and they get indexed more accurately.

    Accessibility is an important idea behind many web standards. Not only does this mean allowing the web to be used by people with disabilities, but also allowing web pages to be understood by people using browsers other than the usual ones—including voice browsers that read web pages aloud to people with sight impairments, Braille browsers, hand-held browsers, teletext displays, and other unusual output devices.

    You can read more about developing with web standards at 456 Berea Street.

  9. Microformats

    Microformats are markup that express semantic information in your blog. People and machines can extract information from webpages marked up in a microformat much like feed readers extract information from Atom or RSS syndicated feeds. Essentially it's about making content more accessible.

    Microformats that have been implemented in the Sandbox theme include (less XFN, which is built into WordPress):

    • hAtom: For all blog posts and pages
    • hCard: For all post and comment authors
    • rel="home": For marking links pointing to the blog home page
    • XOXO: For menu, blogroll, archive, and sidebar lists

    Microformats help the Sandbox be an especially POSH WordPress theme. POSH stands for "plain old semantic HTML." It is a term used to refer to best practices of semantic HTML development.

    So the Sandbox can be highly POSH, but the semantic use of HTML elements is completely up to you, the end user. To learn more about semantic HTML, visit Mezzoblue.

  10. Credits and thanks

    The Sandbox is a collaboration between Andy Skelton and Scott Allan Wallick.

    Thanks to all those who have provided their assistance, know-how, and generally sound advice on all things Sandbox. You are many. But a special thanks to the follow individuals:

    Thanks are due to those who helped ensure the success of the Sandbox Designs Competition:

  11. License

    The Sandbox © 2006–2008 is licensed under the GNU General Public License:

    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


本源码包内暂不包含可直接显示的源代码文件,请下载源码包。