1. Introduction

    Basis has been built to make theme development for WordPress easier. If you are an experienced theme developer or a total beginner, Basis provides a highly customizable starting point for your theme development.

    Basis comes with a pre-defined set of templates. The otherwise empty stylesheet provides a list of IDs und class-names which have already been used in the templates. The theme is widget-ready and introduces a number of custom functions in functions.php. Here are some details:

    Alternative xHTML5

    You can also use the Basis-Theme with xHTML5 Markup. Please see the SVN of the project for more source.

     ↑ 

  2. Project pages

     ↑ 

  3. Templates/structure

    • Basis Theme
      • css
        • reset
          • plugins
            • tripoli.layout.css
            • tripoli.negative.css
            • tripoli.type.css
            • tripoli.visual.css
          • yui
            • reset.css
            • reset-min.css
          • css-reset.css
          • reset.css
          • tripoli.base.css
          • tripoli.base.ie.css
          • tripoli.css
          • tripoli.ie.css
          • tripoli.simple.css
          • tripoli.simple.ie.css
        • ie.css
        • print.css
        • single.css
        • style.css
      • custom-login
        • custom-login.css
      • extra
        • db-error.php
      • js
        • quicktags.js
      • wp-root-tipps
        • .htaccess
        • robots.txt
        • wp-config.php
      • style.css
      • 404.php
      • blog.php
      • comments.php
      • footer.php
      • functions.php
      • header.php
      • image.php
      • index.php
      • page.php
      • search.php
      • searchform.php
      • sidebar.php
      • single.php
      • screenshot.png
      • xx_XX.pot
      • os.xml
  4. Extra functions

    1. WordPress constants
      • Since version 2.6 WordPress relies on constants in many places making access and development easier. Necessairy constants are being looked for and set where they don't exist already.
    2. fb_textdomain
      • Allows multilinguality for themes.
      • Just rename the key 'basis' in define( 'FB_BASIS_TEXTDOMAIN', 'basis' );. All other keys are being pulled automatically through the constant.
    3. wp_count_posts, wp_count_terms, get_comment_count, wp_count_comments
      • Count the number of entries in a blog.
      • More information in this post (German).
    4. Widget support
      • WordPress provides the possibility to integrate new functionalities into your frontend without having to manually access the code of a template file. You can easily activate and position those functionalities with drag&drop to customize your sidebar. This technology is called a "widget".
      • More information in this post (German).
    5. Related posts based on tags fb_get_related_posts()
      • Related posts to the current post based on post-tags.
      • More information in this post (German).
    6. Related posts based on categories fb_get_related_posts()
      • Related posts to the current post based on categories.
      • More information in this post (German).
    7. fb_in_category
      • Returns TRUE if a post is in a sub-category.
    8. get_children_pages
      • Returns the children-pages of a parent-page.
    9. Theme-specific login fb_custom_login()
      • Customizes the WP-login form. You can call the custom CSS-file "custom-login.css" from the directory custom-login by implementing the hook
        add_action('login_head', 'fb_custom_login');
        The required file and directory are included in the theme-directory.
      • More information in these posts (German): 1 and 2
    10. Breadcrumb Navigation fb_breadcrumb_nav()
      • Use the following code in your template to implement a breadcrumb navigation in your WordPress Basis Theme:
      • if ( function_exists('fb_breadcrumb_nav') ) fb_breadcrumb_nav();
      • More information in this post (German)
    11. Advertisements using custom fields fb_example_link()
    12. Display posts directly within another post/page via shortcode fb_get_posts()
      • Returns the WP loop directly within a post/page via shortcodes
      • Simple example of shortcode with 2 parameters: [posts num="5" cat="1"]
    13. Shortcodes for encryted email addresses fb_secure_mail()
      • Encrypt an email address via unicode
      • More informationen about the idea in this post (German)
      • More informationen about the shortcode in this post (German)
      • Example of shortcode with 2 parameters: [sm mailto="foo@bar.com" txt="here is my mail"]
    14. Deactivate shortcodes in posts/pages fb_kill_shortcodes()
      • Delete all other shortcodes in a post/page
      • Shortcode: [KSC][/KSC]
    15. Activate shortcodes within widgets
      • Call the default function via hook
      • add_filter('widget_text', 'do_shortcode');
    16. Reading the user IP fb_getUserCountry()
      • Returns the country the particcular IP is from.
    17. Cache CSS files fb_css_cache_buster()
    18. Tag cloud as a dropdown-menu fb_dropdown_tag_cloud()
      • Tags in a dropdown-menu
    19. Exclude a certain category from the loop fb_exclude_category()
      • Enter the IDs of certain categories within the array to remove them from the loop.
    20. Remove /category/ for better search engine optimization fb_fix_slash()
      • Remove /category/ from permalinks
    21. Add Link Attribute
      • Add attributes to a hyperlink tag.
    22. Regular Expression for hyperlinks fb_add_thickbox()
      • Add a CSS class to any hyperlink with an image, so the image can be viewed with Thickbox.
      • More information in this post (German)
    23. Delayed publishing of posts in feed fb_pulish_later_on_feed()
    24. No pings from your own posts fb_noself_ping()
      • Stop silly self-pings from your own blog.
    25. Comment markup fb_theme_comment()
      • Return markup and content of a certain comment.
    26. Count comments, pings and trackbacks fb_comment_type_count()
    27. Check for duplicate meta-tag "robots" fb_comment_paging_noindex_meta()
      • Avoid duplicate content in paginated comments.
      • More information in this post
    28. Display ads only for visitors from search engines fb_fromasearchengine()
      • Use this function to display banners or text-links only for visitors coming from a search engine. The function call fb_fromasearchengine() evaluates the referrer of each visitor. To add more search go to functions.php.
      • Example:
        if ( function_exists('fb_fromasearchengine') ) { 
        	if ( fb_fromasearchengine() ) {
        		PLATZHALTER FÜR HTML-/BANNER-CODE etc.
        	} 
        }
    29. Remove more tags fb_remove_more_anchor()
      • Remove more-tags from content.
      • Go to functions.php and activate the hook add_filter('the_content', 'fb_remove_more_anchor');
      • Note: You can also use the variable $more to do the same thing within your template. Just add: global $more; $more = 1;
    30. Delete comment data automatically fb_delete_comments_data()
      • Using fb_delete_comments_data() all comment data of the last 15 days are deleted. The automatism saves database file size and protects you from future legal issues if you are a German resident.
    31. Alternative Doctype fb_alternate_doctype()
      • Sometimes you have to use an alternative doctype on certain pages. This function handles the value of the variable $newdoctype as the new doctype.
      • Simply call the function within your template and use conditional tags where appropriate.
      • Example:
        if ( is_page('about') ) fb_alternate_doctype(); 
    32. Generate TinyURL fb_gettinyurl()
      • Simple function to generate a TinyURL using the TinyURL.com API
      • More information in this post (German) von René Ade
    33. Filter rewrite rule fb_filter_rewrite_attachment()
      • Can enhance performance where disadvantageous permalinks are activated.
      • Use within your template like: var_dump( get_option('rewrite_rules') );.
      • Outcomment both filters to activate the function.
    34. Check for useragent fb_agent()
      • Check for a visitor's useragent and do something with it,
      • e.g. load an extra stylesheet for a mobile client.
      • Example:
        if ( (fb_agent("iPhone") != FALSE) || (fb_agent("iPod") != FALSE) ) {
        	...
        }
    35. Tags of a post fb_meta_tags()
      • Read the tags of a post and return them to the meta-tag as keywords.
      • Example:
        <?php if (function_exists('fb_meta_tags') ) { fb_meta_tags(); } ?>
      • Generates HTML like:
        <meta name="keywords" content="test,bueltge," />
    36. Filter excerpt fb_clean_excerpt()
      • Remove JavaScript and CSS from the excerpt.
    37. Filter excerpt #2 fb_trim_excerpt()
      • Remove [...] from the excerpt or set an alternative.
    38. Remove the nofollow attribute from the comment author link fb_strip_nofollow()
      • Remove rel="nofollow" from the comment author link
    39. Check for parent and child pages fb_has_parent()
      • Uses a page ID and checks if the actual page is the parent or a child page.
      • if ( function_exists('fb_has_parent') ) {
        	if ( fb_has_parent($wp_query->post, 3) ) { ... }
        } ;
    40. Disable canonical URL redirection template_redirect
      • Removes the canonical URL functions which has been implemented into WP since version 2.3.
      • Outcomment hook to activate the function.
    41. Add contact field fb_add_twitter_contactmethod
      • Add a new field in the user settings on the backend, since WP 2.9
      • Example: add_filter( 'user_contactmethods', 'fb_add_twitter_contactmethod', 10, 1 )
    42. Select all users that have a specific role fb_getUsersByRole
      • Return the user-IDs for specific rolle.
      • Example: $userid = fb_getUsersByRole( 'author' )
    43. Removing typographic widows in page titles fb_getUsersByRole
      • A widow in typography is the one lowly word that gets displayed on a line of its own within a heading.
      • The function pre-filters it so that the last two words are separated not with a space but with a &nbsp; instead
      • This tricks the browser into not breaking up the word.

     ↑ 

  5. Tips for the WP main directory

    For an easy and safe installation the WordPress Basis Theme comes with a modified

    • wp-config.php,
    • robots.txt and
    • .htaccess.

    Make your own choice which ideas and solutions you would like to use. Search the web for explanations.

     ↑ 

  6. Tips for the reset section in the CSS stylesheet

    This theme provides multiple options to reset the CSS styles to a common standard for all browsers. Choose one option and use the linked ressources to retrieve deeper information on the matter.

    1. CSS framework Tripoli

      To standardize the interpretation of CSS attributes within browsers from Internet Explorer 5 up to Firefox 3, the WordPress Basis Theme comes with an included CSS Framework Tripoli. The idea has been realized by David Hellsing.

    2. CSS reset by Eric Meyer

      The CSS reset by Eric Meyer resets all internal browser styles and requires a complete re-definition of all styles.

      "The reset styles given here are intentionally very generic. There isn't any default color or background set for the body element, for example. I don't particularly recommend that you just use this in its unaltered state in your own projects. It should be tweaked, edited, extended, and otherwise tuned to match your specific reset baseline. Fill in your preferred colors for the page, links, and so on."

    3. Yahoo User Interface Reset

      The foundational YUI Reset CSS file removes and neutralizes the inconsistent default styling of HTML elements, creating a level playing field across A-grade browsers and providing a sound foundation upon which you can explicitly declare your intentions.

    4. Ed Eliot´s Reset - Less is more

      Many CSS resets just go too far. Eliot´s solution only regards a selection of elements that are used more often.

    5. Short and slim

      * {
      margin: 0;
      padding: 0;	
      }

     ↑ 

  7. Download

     ↑ 

  8. Credits

     ↑ 

  9. Project team

     ↑ 

  10. License

    Basis Theme © 2007 – 2009 has been published 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.

     ↑