The WordPress Template Hierarchy

http://codex.wordpress.org/Template_Hierarchy

The General Idea

WordPress uses the Query String — information contained within each link on your web site — to decide which template or set of templates will be used to display the page.

To see the query string put this in your theme’s page template:

<?php
echo "<pre>"; print_r($wp_query->query_vars); echo "</pre>";
?>

WordPress matches every Query String to query types — i.e. it decides what type of page (a search page, a category page, the home page etc.) is being requested.

Templates are then chosen — and web page content is generated — in the order suggested by the WordPress Template hierarchy, depending upon what templates are available in a particular WordPress Theme. Read More

Roots 101 – Notes, tips, and more

1. The Theme Wrapper

http://roots.io/an-introduction-to-the-roots-theme-wrapper/

The goal of a theme wrapper [3] is to remove any repeated markup from individual templates and put it into a single file. This file, base.php becomes the single, unambiguous, authoritative representation of knowledge (i.e. the base format code).

You never need to make calls to get_header()get_footer() or get_sidebar() again. You can also refactor the base format of your site by editing  base.php. Read More

cygwin permissions

I ran into some problems with files copied from the cygwin command line not having administrator permissions. WAMP for instance didn’t have access to these files, which is not fun.

I took this advice (found here)

As a general rule, if you are going to mix Cygwin and native tools, let windows handle file permissions ("noacl" mount option), and you'll not see such issues again.

Not sure if this is the best solution, but I added the option noacl to etc/fstab, rebooted Windows and it seems to work fine now.

# This is default anyway:
none /cygdrive cygdrive binary,noacl,posix=0,user 0 0

Starting a new WP project with WP-Skeleton

Install using Mark Jaquith’s method. This involves

  1. Handling differing database connection details
  2. Handling plugins that can’t or shouldn’t run on a localhost

Create a local subdirectory. Then clone Mark Jaquith’s wp-skeleton into a new directory www. Or, if you already did the steps below, clone it directly from your own fork.

Note: use recursive cloning otherwise the submodule will not be cloned:
Read More