WordPress API Integration
The goal of Kazoo Templated Content is to provide simple access to specific portions of the WordPress API without requiring the need for PHP coding. There are two ways that Kazoo accomplishes this.
The first way is to provide simple data to the template engine by setting values in the template engine that are provided directly or indirectly by WordPress itself. These are data elements that provide information on the client, whether he is logged in or not, what type of page is being viwed and so on. These data elements are common to every page view and are therefore provided to every template engine that may be invoked. These values are:
wp_version – string, the current version of wordpress
is_home – true if this the sites home page, false otherwise
is_front_page – true if this is the sites front page, false otherwise
is_single – true if this is a single post, false otherwise
is_sticky – true if this is a stick post, false otherwise
is_page – true if this is a page rather than a post, false otherwise
is_category – true if this is a category page, false otherwise
is_admin – true if this is an admin page, false otherwise
user_ip – the ip address of the client
user_id – the id of the current user
is_user – true if the user is logged in, false otherwise
The other way in which Kazoo provides access to the WordPress API is through custom template tags coded against important functions of WordPress API such as get_posts, get_pages, get_userinfo among others. Some of these template tags only provide additional data to the template engine while some provide condiional constructs based upon the user, the type of page being viewed, etc. The most important of these methods are those while provide access to the wordpress posts loop wherein posts, pages, comments and attachment data may be retrieved and substituted into a template.