Photos WordPress

Photos: WordPress VIP Training in Napa Valley

Code WordPress

WordPress: Create a Plugin to Create Custom Taxonomies

An example plugin that demonstrates how to easily add new Taxonomies to your WordPress blog.

Plugin Name: Yor Custom Taxonomies
Plugin URI:
Description: Adds custom taxonomies for your WordPress blog
Version: 1.0.0
Author: Steven Word
Author URI:

function skw_build_taxonomies() {

 $vehicle_args = array(
 'label' => 'Vehicles',
 'hierarchical' => true,
 'query_var' => true,
 'rewrite' => array('slug' => 'vehicles')
 register_taxonomy( 'skw_vehicles', 'post', $vehicle_args );

 $brand_args = array(
 'label' => 'Brands',
 'hierarchical' => true,
 'query_var' => true,
 'rewrite' => array('slug' => 'brands')
 register_taxonomy( 'skw_brands', 'post', $brand_args );

add_action( 'init', 'skw_build_taxonomies', 0 );

Code WordPress

WordPress: Exclude Pages from Search Results

Add the following to your functions.php file to exclude pages from the search results of your WordPress blog.

//Filter out pages from search results
function search_exclude_pages($query) {
 if ($query->is_search) {
 $query->set('post_type', 'post');
 return $query;
Code WordPress

WordPress: Change the Excerpt Length

The following can be added to your theme’s functions.php to alter the excerpt word count.

//Filter the excerpt
function new_excerpt_length($length) {
 return 20;
add_filter('excerpt_length', 'new_excerpt_length');