WP theming

From Things and Stuff Wiki
Jump to navigation Jump to search

todo; fill out, rearrange and link up

Templates

Theme Features

  • Theme Features allows a theme to register support of a certain feature. Theme support functions should be called in the theme's functions.php file to work.

Settings API

  • Settings API - Allows admin pages containing settings forms to be managed semi-automatically. It lets you define settings pages, sections within those pages and fields within the sections.
    • Example given for choosing a background image.

Options API

  • Options API - a simple and standardized way of storing data in the database. The API makes it easy to create, access, update, and delete those options. All the data is being stored in the wp_options table under a given custom name. This page contains the technical documentation use the Options API.

Theme Options

todo; compare;

Preprocess

See also preprocess, sass.

SASS/SCSS

  • wp-sass - This plugin allows you to write and edit .sass and .scss files directly and have WordPress do the job of compiling and caching the resulting CSS. It eliminates the extra step of having to compile the files into CSS yourself before deploying them.
    • uses phpsass!

install;

git clone git://github.com/sanchothefat/wp-sass.git wp-sass
git submodule update --init --recursive

functions.php:

<?php

// Include the class (unless you are using the script as a plugin)
require_once( 'wp-sass/wp-sass.php' );

// enqueue a .less style sheet
if ( ! is_admin() )
   wp_enqueue_style( 'style', get_stylesheet_directory_uri() . '/style.scss' );
else
   wp_enqueue_style( 'admin', get_stylesheet_directory_uri() . '/admin.sass.php' );

// you can also use .less files as mce editor style sheets
add_editor_style( 'editor-style.sass' );

?>

You can also create .sass.php or .scss.php files that will be preprocessed in the WordPress context. What this means is that you can use WordPress functions within the stylesheets themselves eg:

$red: <?php echo get_option( 'redcolour', '#c00' ); ?>;

body {
  background: $red;
}

LESS

  • WP-LESS - Implementation of LESS (Leaner CSS) in order to make themes development easier.
    • uses lessphp v0.3.1, plugin-toolkit.

Process, etc.

  • Theme Review - Guidelines for designing and developing WordPress Themes plus WordPress Theme Directory standards and practices.

Theme customizer in 3.4 - still need to grok relation to Settings API, etc...

GUI

Testing

Layout

Sidebars

Typography

quick webfont plugin hack;