thetoine / wish-you-were-simple

A stripped down WordPress for theme developers.

This URL has Read+Write access

README.markdown

Wish You Were Simple

Stripped down theme for WordPress.

Sidebars

This theme come with 3 sidebar zones (à la Drupal blocks). Your existing widgets might end up in header zone by default, just move them to sidebar zone.

if ( function_exists('register_sidebar') ) {
    register_sidebar(array( 'name' => '(1) Header', 'before_widget' => '<div id="%1$s" class="header-widgets widget %2$s">', 'after_widget' => '</div>'));
  register_sidebar(array( 'name' => '(2) Sidebar', 'before_widget' => '<li id="%1$s" class="sidebar-widgets widget %2$s">', 'after_widget' => '</li>'));
    register_sidebar(array( 'name' => '(3) Footer', 'before_widget' => '<div id="%1$s" class="footer-widgets widget %2$s">', 'after_widget' => '</div>'));
}

function.php

Assets

Stylesheets and Javascripts are loaded through wp_head() filter.

Add CSS to load with $stylesheets array :

$stylesheets = array(
    "reset.css",
    "style.css"
    "some-path/my-cute-stylesheet.css"
);

Add scripts to load with $scripts array :

$stylesheets = array(
    "reset.css",
    "style.css"
    "some-path/my-cute-stylesheet.css"
);

$version global is used for preventing browser caching. Change as you release to another random value.

Theme Options Page

This theme come with basic theme option that you can use in your theme file.

Options can be grouped by sets, simply populate the options_sets array with additional options.

$options_sets = array(
    'sets' => array(
        'title' => 'Misc.',
        'intro_text' => 'Change misc. settings here.',
        'set_options' => array(
            0 => array(
                'label' => 'Google Analytics Account ID',
                'help_text' => 'Insert only your tracker ID (UA-XXXXXXX-X). Leave empty for no tracking',
                'type' => 'text', // available: text, textarea
                'option_slug' => 'google_analytics_id' // option name, slugifed, no spaces or accents
            )
        )
    )
);

Access them in your theme with get_option(option_name)

Included javascripts

Javascript constants

  • WP_THEME_PATH = export current theme path

Credits