SlideShare uma empresa Scribd logo
1 de 68
Baixar para ler offline
Surviving the Zombie Apocalypse using
Custom Post Types and Taxonomies




                       Brad Williams
                       WebDevStudios.com
                       @williamsba
Who Am I?
Brad Williams
Co-Founder of WebDevStudios.com
Co-Host SitePoint Podcast
Co-Author of Professional WordPress (http://bit.ly/pro-wp)
 & Professional WordPress Plugin Development
  (http://amzn.to/plugindevbook)
Topics

 How    to Kill Zombies
Topics

 How  to Kill Zombies
 Explain Custom Post Types and Taxonomies
 Create Custom Post Types
 Create Custom Taxonomies
 Hooking into WordPress
So What Are
Custom Post Types?
So What Are
        Custom Post Types?
Post type refers to the various structured data that is maintained in the
WordPress posts table.
Huh?
So What Are
Custom Post Types Really?


ENGLISH: Custom Post Types allow you to create different types of
content in WordPress.
Default WordPress Post Types:


      • Posts
      • Pages
      • Attachments
      • Revisions
      • Nav Menus
Custom Post Type Ideas
• Podcasts
• Movies
• Bars
• Forum            The
• Quotes
• Videos           possibilities
• Cars             are endless!
• House Listings
• Events
• Ticket System
• etc, etc, etc
To defeat your enemy you
          must know your enemy




Tweet: @williamsba CAUTION ZOMBIES AHEAD! #wcraleigh
         Win a copy of Professional WordPress!
To defeat your enemy you
           must know your enemy
Type: Nerd Zombies

Speed: Slow

Favorite Body Part: Braaaaaains
To defeat your enemy you
            must know your enemy
Type: Nazi Zombies

Speed: Fast

Favorite Part: Buttocks
To defeat your enemy you
            must know your enemy
Type: Baby Zombies

Speed: Crawl

Favorite Part: Fingers
To defeat your enemy you
            must know your enemy
Type: Kitty Zombies

Speed: Lightning Fast

Favorite Part: Fingers
Example:

          Drop the below code in your themes functions.php file



     <?php
     add_action( 'init', 'wc_raleigh_cpt_init' );

     function wc_raleigh_cpt_init() {

       register_post_type( 'zombies' );

     }
     ?>
That’s it!

Questions?
Example:

      Drop the below code in your themes functions.php file



                               Where is it?
Example:

     Set the public and label parameters for the custom post type



     <?php
     add_action( 'init', 'wc_raleigh_cpt_init' );

     function wc_raleigh_cpt_init() {

       $arrrrgs = array(
              'public' => true,
              'label'   => 'Zombies'
       );

       register_post_type( 'zombies', $arrrrgs );

     }
     ?>
Example:
           It’s Alive!




                Our new “Zombies” post
                type is now visible in the
                WP dashboard!
Example:

                             Lets break it down:
                                         <?php
1. Action hook to trigger our function   add_action( 'init', 'wc_raleigh_cpt_init' );

2. Execute the register_post_type        function wc_raleigh_cpt_init() {
function defining zombies as our
custom post type                           $arrrrgs = array(
                                                  'public' => true,
3. Set the label to Zombies                       'label'   => 'Zombies'
                                           );
4. Set public to true. By default
public is false which will hide your       register_post_type( 'zombies', $arrrrgs );
post type
                                         }
                                         ?>
Additional Arguments: labels
Additional Arguments: labels
         An array of strings that represent your post type in the WP admin



 name: The plural form of the name of your post type.
 singular_name: The singular form of the name of your post type.
 add_new: The menu item for adding a new post.
 add_new_item: The header shown when creating a new post.
 edit_item: The header shown when editing a post.
 new_item: Shown in the favorites menu in the admin header.
 view_item: Shown alongside the permalink on the edit post screen.
 search_items: Button text for the search box on the edit posts screen.
 not_found: Text to display when no posts are found through search in the admin.
 not_found_in_trash: Text to display when no posts are in the trash.
 menu_name – Text used in the WP dashboard menu



Ref: http://codex.wordpress.org/Function_Reference/register_post_type#Parameters
Additional Arguments: labels
     An array of strings that represent your post type in the WP admin

     add_action( 'init', 'wc_raleigh_cpt_init' );

     function wc_raleigh_cpt_init() {

         $labels = array(
                    'name' => 'Zombies',
                    'singular_name' => 'Zombie',
                    'add_new' => 'Add New Zombie',
                    'add_new_item' => 'Add New Zombie',
                    'edit_item' => 'Edit Zombie',
                    'new_item' => 'New Zombie',
                    'view_item' => 'View Zombie',
                    'search_items' => 'Search Zombies',
                    'not_found' => 'No zombies found',
                    'not_found_in_trash' => 'No zombies found in Trash',
                    'menu_name' => 'Zombies'
         );

         $arrrrgs = array(
                    'public'   => true,
                    'labels'   => $labels
         );

         register_post_type( 'zombies', $arrrrgs );

     }
Additional Arguments: labels
             The Result
Additional Arguments: supports
    Defines what meta boxes and other fields appear on the edit screen



    title: Text input field for the post title.
    editor: Main content meta box
    comments: Ability to turn comments on/off.
    trackbacks: Ability to turn trackbacks and pingbacks on/off.
    revisions: Allows revisions to be made of your post.
    author: Displays the post author select box.
    excerpt: A textarea for writing a custom excerpt.
    thumbnail: The post thumbnail (featured imaged) upload box.
    custom-fields: Custom fields input area.
    page-attributes: The attributes box shown for pages. Important for
    hierarchical post types, so you can select the parent post.
    post-formats: Add post formats
Additional Arguments: supports
    Defines what meta boxes and other fields appear on the edit screen
      register_post_type('zombies',
                   array(
                                'labels' => array(
                                               'name' => 'Zombies',
                                               'singular_name' => 'Zombie',
                                               'add_new' => 'Add New Zombie',
                                               'add_new_item' => 'Add New Zombie',
                                               'edit' => 'Edit Zombies',
                                               'edit_item' => 'Edit Zombie',
                                               'new_item' => 'New Zombie',
                                               'view' => 'View Zombie',
                                               'view_item' => 'View Zombie',
                                               'search_items' => 'Search Zombies',
                                               'not_found' => 'No zombies found',
                                               'not_found_in_trash' => 'No zombies found in Trash',
                                               'parent' => 'Parent Zombie',
                                ),
                                'supports' => array('title'),
                                'public' => true,
                                )
                   );
Additional Arguments: supports
    Defines what meta boxes and other fields appear on the edit screen




           Only the Title and Publish meta boxes are displayed
Additional Arguments: supports
                               Now lets activate all meta boxes
    $labels = array(
                 'name' => 'Zombies',
                 'singular_name' => 'Zombie',
                 'add_new' => 'Add New Zombie',
                 'add_new_item' => 'Add New Zombie',
                 'edit_item' => 'Edit Zombie',
                 'new_item' => 'New Zombie',
                 'view_item' => 'View Zombie',
                 'search_items' => 'Search Zombies',
                 'not_found' => 'No zombies found',
                 'not_found_in_trash' => 'No zombies found in Trash',
                 'menu_name' => 'Zombies'
      );

     $arrrrgs = array(
                'public' => true,
                'labels' => $labels,
                'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks',
                     'custom-fields', 'comments', 'revisions', 'page-attributes', 'post-formats' )
     );

     register_post_type( 'zombies', $arrrrgs );
Additional Arguments: supports
     Now all meta boxes are displayed on the Zombie edit screen
Additional Arguments: rewrite
           Defines the permalink structure of your custom post type posts


         slug: The slug to use in your permalink structure


             Example:     'rewrite' => array('slug' => 'enemy')




  BEFORE

    AFTER
 TIP: If you receive a 404 after setting a custom rewrite visit Settings > Permalinks
 and save your permalink settings to flush the rewrite rules in WordPress
Additional Arguments: taxonomies
                Add pre-existing taxonomies to your custom post type



Example:
'taxonomies' =>
array( 'post_tag',
'category')
Additional Arguments: misc
     Below are additional arguments for creating custom post types



    hierarchical: whether the post type is hierarchical
    description: a text description of your custom post type
    show_ui: whether to show the admin menus/screens
    menu_position: Set the position of the menu order where the post
    type should appear
    menu_icon: URL to the menu icon to be used
    exclude_from_search: whether post type content should appear
    in search results
    can_export: Can this post type be exported
    show_in_menu: Whether to show the post type in an existing
    admin menu
    has_archive: Enables post type archives
Additional Arguments: show_in_menu
        Add the custom post type to an existing menu


        'show_in_menu' => 'edit.php?post_type=page'



    BEFORE                           AFTER
Additional Arguments: has_archive
               Creates a default page to list all entries in a post type

                          has_archive' => ‘enemies'




 http://example.com/enemies/


   Now lists zombie posts



  Can also create a theme
  template named
  archive-zombies.php
Putting it all together
add_action( 'init', 'wc_raleigh_cpt_init' );

function wc_raleigh_cpt_init() {

    $labels = array(
               'name' => 'Zombies',
               'singular_name' => 'Zombie',
               'add_new' => 'Add New Zombie',
               'add_new_item' => 'Add New Zombie',
               'edit_item' => 'Edit Zombie',
               'new_item' => 'New Zombie',
               'view_item' => 'View Zombie',
               'search_items' => 'Search Zombies',
               'not_found' => 'No zombies found',
               'not_found_in_trash' => 'No zombies found in Trash',
               'menu_name' => 'Zombies'
    );

   $arrrrgs = array(
              'public' => true,
              'labels' => $labels,
              'rewrite' => array('slug' => 'enemy'),
              'taxonomies' => array( 'post_tag', 'category'),
              'show_in_menu' => 'edit.php?post_type=page',
              'has_archive' => 'enemies',
              'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields',
'comments', 'revisions', 'page-attributes', 'post-formats' )
   );

    register_post_type( 'zombies', $arrrrgs );

}
Now that we know the enemy
  we must kill the enemy
Zombie Weapons

Type: Machete

Nickname: Butter Cutter

Gore Factor: Moderate

Kill Speed: Swift
Zombie Weapons

Type: Spiked Bat

Nickname: Pokie

Gore Factor: Gore-cano

Kill Speed: Slow
Zombie Weapons

Type: Chainsaw

Nickname: Old Faithful

Gore Factor: Over the Top

Kill Speed: Slow and Steady
Zombie Weapons

Type: All in One Zombie Killer

Nickname: The Torbert

Gore Factor: Messy or Clean. You Choose!

Kill Speed: Instant
Weapons Custom Post Type
                          Create another custom post type for Weapons
$labels = array(
              'name' => 'Weapons',
              'singular_name' => 'Weapon',
              'add_new' => 'Add New Weapon',
              'add_new_item' => 'Add New Weapon',
              'edit_item' => 'Edit Weapon',
              'new_item' => 'New Weapon',
              'view_item' => 'View Weapon',
              'search_items' => 'Search Weapons',
              'not_found' => 'No weapons found',
              'not_found_in_trash' => 'No weapons found in Trash',
              'menu_name' => 'Weapons'
   );

  $arrrrgs = array(
             'public' => true,
             'labels' => $labels,
             'rewrite' => array('slug' => 'weapon'),
             'has_archive' => 'weapons',
             'supports' => array( 'title', 'editor', 'thumbnail' )
  );

  register_post_type( 'weapons', $arrrrgs );
So what are Taxonomies?




ENGLISH: Taxonomies are a way to group similar items together
Default WordPress Taxonomies:


      • Category
      • Tag
      • Link Category
Example Time!




Tweet: @williamsba ZOMBIES IN AREA! RUN #wcraleigh
         Win a copy of Professional WordPress!
Example:

        Drop the below code in your themes functions.php file



     <?php
     $arrrrgs = array(
              'label'  => ‘Speed'
       );

       register_taxonomy( ‘speed', 'zombies', $arrrrgs );
     ?>




                     Non-hierarchical Taxonomy
Example:
            New custom taxonomy is
           automatically added to the
            Zombies post type menu

           The Speed meta box is also
            automatically added to the
               Zombie edit screen!
Additional Arguments: hierarchical
           Give the custom taxonomy hierarchy


                 ‘hierarchical' => true



    BEFORE                            AFTER
Additional Arguments: labels
        An array of strings that represent your taxonomy in the WP admin



 name: The general name of your taxonomy
 singular_name: The singular form of the name of your taxonomy.
 search_items: The search items text
 popular_items: The popular items text
 all_items: The all items text
 parent_item: The parent item text. Only used on hierarchical taxonomies
 parent_item_colon: Same as parent_item, but with a colon
 edit_item: The edit item text
 update_item: The update item text
 add_new_item: The add new item text
 new_item_name: The new item name text
 separate_items_with_commas: The separate items with commas text
 add_or_remove_items: The add or remove items text
 choose_from_most_used: The choose from most used text
 menu_name: The string used for the menu name
Additional Arguments: labels
     An array of strings that represent your taxonomy in the WP admin



              $labels = array(
                           'name' => 'Speed',
                           'singular_name' => 'Speed',
                           'search_items' => 'Search Speeds',
                           'all_items' => 'All Speeds',
                           'parent_item' => 'Parent Speed',
                           'parent_item_colon' => 'Parent Speed:',
                           'edit_item' => 'Edit Speed',
                           'update_item' => 'Update Speed',
                           'add_new_item' => 'Add New Speed',
                           'new_item_name' => 'New Genre Speed',
                           'menu_name' => 'Speed'
                );

               $arrrrgs = array(
                          'hierarchical' => false,
                          'labels' => $labels
               );

               register_taxonomy( 'speed', 'zombies', $arrrrgs );
Additional Arguments: labels
              The Result
Additional Arguments: rewrite
      Defines the permalink structure for your custom taxonomy


        slug: The slug to use in your permalink structure




      Example:     'rewrite' => array( 'slug' => ‘quickness' )




   BEFORE              http://example.com/speed/ripe/




    AFTER              http://example.com/quickness/ripe/
Additional Arguments: misc
     Below are additional arguments for creating custom taxonomies



    public: whether the taxonomy is publicly queryable
    show_ui: whether to display the admin UI for the taxonomy
    query_var: whether to be able to query posts using the taxonomy.

    show_tagcloud: whether to show a tag cloud in the admin UI
    show_in_nav_menus: whether the taxonomy is available for
    selection in nav menus
Putting it all together

          $labels = array(
                   'name' => 'Speed',
                   'singular_name' => 'Speed',
                   'search_items' => 'Search Speeds',
                   'all_items' => 'All Speeds',
                   'parent_item' => 'Parent Speed',
                   'parent_item_colon' => 'Parent Speed:',
                   'edit_item' => 'Edit Speed',
                   'update_item' => 'Update Speed',
                   'add_new_item' => 'Add New Speed',
                   'new_item_name' => 'New Genre Speed',
                   'menu_name' => 'Speed'
          );

          $arrrrgs = array(
                   'hierarchical' => false,
                   'labels' => $labels
          );

          register_taxonomy( 'speed', 'zombies', $arrrrgs );
Displaying in WordPress




         #protip
Displaying Custom Post Type Content


By default custom post type content will NOT display in the Loop



            <?php query_posts( array( 'post_type' => 'zombies' ) ); ?>




Placing the above code directly before the Loop will only display our zombies
Displaying Custom Post Type Content
                                                               (After)
           BEFORE                                            ZOMBIED




<?php query_posts( array( 'post_type' => 'zombies' ) ); ?>
Custom Loop

                      Creating a custom Loop for your post type

<?php
$zombies = new WP_Query( array( 'post_type' => 'zombies', 'posts_per_page' => 1, 'orderby' => 'rand' ) );

while ( $zombies->have_posts() ) : $zombies->the_post();

          the_title( '<h2><a href="' . get_permalink() . '" >', '</a></h2>' );
          ?>
          <div class="entry-content">
                       <?php the_content(); ?>
          </div>
<?php endwhile; ?>
Custom Post Type Functions
                       Function: get_post_type()
           Returns the post type of the content you are viewing

<?php
if (have_posts()) : while (have_posts()) : the_post();

  $post_type = get_post_type( get_the_ID() );
  if ($post_type == 'zombies') {
            echo 'This is a Zombie!';
  }
?>

<?php endwhile; ?>
<?php endif; ?>




    http://codex.wordpress.org/Function_Reference/get_post_type
Custom Post Type Functions
            Function: post_type_exists()


         Check if a post type exists
      if ( post_type_exists( 'zombies' ) ) {
                   echo 'Zombies Exist!';
      }




             Function: get_post_types()


List all registered post types in WordPress
      $post_types = get_post_types( '','names' );
      foreach ( $post_types as $post_type ) {
         echo '<p>'. $post_type. '</p>';
      }
Custom Taxonomy Functions
                 Function: get_the_term_list()
Display speed taxonomy for our zombies
   <?php echo get_the_term_list( $post->ID, speed', ‘Speed: ', ', ', '' ); ?>




http://codex.wordpress.org/Function_Reference/get_the_term_list
Recommended Plugin
Custom Post Type UI
 Easily create custom post types without writing code!




http://wordpress.org/extend/plugins/custom-post-type-ui/
Custom Post Type UI
Also easily create custom taxonomies without writing code!




 http://wordpress.org/extend/plugins/custom-post-type-ui/
Custom Post Type UI
Plugin also gives you the PHP code for custom post types and taxonomies!




         http://wordpress.org/extend/plugins/custom-post-type-ui/
Custom Post Type and Taxonomy Resources

   Related Codex Articles
    ›   http://codex.wordpress.org/Post_Types
    ›   http://codex.wordpress.org/Function_Reference/register_post_type
    ›   http://codex.wordpress.org/Taxonomies
   Custom Post Type Articles
    ›   http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress
    ›   http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-
        blog-page
    ›   http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/
    ›   http://wpengineer.com/impressions-of-custom-post-type/
    ›   http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/


   Custom Taxonomies
    ›   http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28
    ›   http://justintadlock.com/archives/2009/06/04/using-custom-taxonomies-to-create-a-movie-
        database
    ›   http://www.shibashake.com/wordpress-theme/wordpress-custom-taxonomy-input-panels
Contact
Brad Williams
brad@webdevstudios.com

Blog: strangework.com
Twitter: @williamsba
IRC: WDS-Brad




                http://amzn.to/plugindevbook http://bit.ly/pro-wp

Mais conteúdo relacionado

Mais procurados

前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说Ting Lv
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code OrganizationRebecca Murphey
 
Drupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of UsageDrupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of UsageRonald Ashri
 
Coding for Scale and Sanity
Coding for Scale and SanityCoding for Scale and Sanity
Coding for Scale and SanityJimKellerES
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryRebecca Murphey
 
Exhibition of Atrocity
Exhibition of AtrocityExhibition of Atrocity
Exhibition of AtrocityMichael Pirnat
 
JS Level Up: Prototypes
JS Level Up: PrototypesJS Level Up: Prototypes
JS Level Up: PrototypesVernon Kesner
 
JavaScript Libraries Overview
JavaScript Libraries OverviewJavaScript Libraries Overview
JavaScript Libraries OverviewSiarhei Barysiuk
 
Beyond Breakpoints: Advanced Debugging with XCode
Beyond Breakpoints: Advanced Debugging with XCodeBeyond Breakpoints: Advanced Debugging with XCode
Beyond Breakpoints: Advanced Debugging with XCodeAijaz Ansari
 
Extending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post TypesExtending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post TypesUtsav Singh Rathour
 
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionDirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionAdam Trachtenberg
 
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsSymfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsIgnacio Martín
 
파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)성일 한
 

Mais procurados (19)

The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code Organization
 
Drupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of UsageDrupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of Usage
 
Coding for Scale and Sanity
Coding for Scale and SanityCoding for Scale and Sanity
Coding for Scale and Sanity
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
 
Mocking Demystified
Mocking DemystifiedMocking Demystified
Mocking Demystified
 
ddd+scala
ddd+scaladdd+scala
ddd+scala
 
Exhibition of Atrocity
Exhibition of AtrocityExhibition of Atrocity
Exhibition of Atrocity
 
Build your own entity with Drupal
Build your own entity with DrupalBuild your own entity with Drupal
Build your own entity with Drupal
 
JS Level Up: Prototypes
JS Level Up: PrototypesJS Level Up: Prototypes
JS Level Up: Prototypes
 
JavaScript Libraries Overview
JavaScript Libraries OverviewJavaScript Libraries Overview
JavaScript Libraries Overview
 
Beyond Breakpoints: Advanced Debugging with XCode
Beyond Breakpoints: Advanced Debugging with XCodeBeyond Breakpoints: Advanced Debugging with XCode
Beyond Breakpoints: Advanced Debugging with XCode
 
Extending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post TypesExtending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post Types
 
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionDirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP Extension
 
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsSymfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worlds
 
Phactory
PhactoryPhactory
Phactory
 
jQuery Selectors
jQuery SelectorsjQuery Selectors
jQuery Selectors
 
파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #4 (ABCD)
 

Semelhante a Surviving the Zombie Apocalypse using Custom Post Types and Taxonomies

Custom Post Types and Taxonomies in WordPress
Custom Post Types and Taxonomies in WordPressCustom Post Types and Taxonomies in WordPress
Custom Post Types and Taxonomies in WordPressBrad Williams
 
Dig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoDig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoMohamed Mosaad
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!techvoltz
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!techvoltz
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!techvoltz
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!techvoltz
 
Creatively creating custom post types! word sesh2
Creatively creating custom post types!  word sesh2Creatively creating custom post types!  word sesh2
Creatively creating custom post types! word sesh2techvoltz
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post TypesK.Adam White
 
WordPress Cuztom Helper
WordPress Cuztom HelperWordPress Cuztom Helper
WordPress Cuztom Helperslicejack
 
Mastering Custom Post Types - WordCamp Atlanta 2012
Mastering Custom Post Types - WordCamp Atlanta 2012Mastering Custom Post Types - WordCamp Atlanta 2012
Mastering Custom Post Types - WordCamp Atlanta 2012Mike Schinkel
 
Moose - YAPC::NA 2012
Moose - YAPC::NA 2012Moose - YAPC::NA 2012
Moose - YAPC::NA 2012xSawyer
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress sitereferences
 
Custom Post Types in WP3
Custom Post Types in WP3Custom Post Types in WP3
Custom Post Types in WP3gregghenry
 
Ajax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsAjax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsTse-Ching Ho
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 
WordPress Theme Workshop: Sidebars
WordPress Theme Workshop: SidebarsWordPress Theme Workshop: Sidebars
WordPress Theme Workshop: SidebarsDavid Bisset
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Evan Mullins
 
Pyimproved again
Pyimproved againPyimproved again
Pyimproved againrik0
 

Semelhante a Surviving the Zombie Apocalypse using Custom Post Types and Taxonomies (20)

Custom Post Types and Taxonomies in WordPress
Custom Post Types and Taxonomies in WordPressCustom Post Types and Taxonomies in WordPress
Custom Post Types and Taxonomies in WordPress
 
Dig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoDig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup Cairo
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!
 
Creatively creating custom post types!
Creatively creating custom post types!Creatively creating custom post types!
Creatively creating custom post types!
 
Creatively creating custom post types! word sesh2
Creatively creating custom post types!  word sesh2Creatively creating custom post types!  word sesh2
Creatively creating custom post types! word sesh2
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
 
WordPress Cuztom Helper
WordPress Cuztom HelperWordPress Cuztom Helper
WordPress Cuztom Helper
 
Quality code by design
Quality code by designQuality code by design
Quality code by design
 
Mastering Custom Post Types - WordCamp Atlanta 2012
Mastering Custom Post Types - WordCamp Atlanta 2012Mastering Custom Post Types - WordCamp Atlanta 2012
Mastering Custom Post Types - WordCamp Atlanta 2012
 
Moose - YAPC::NA 2012
Moose - YAPC::NA 2012Moose - YAPC::NA 2012
Moose - YAPC::NA 2012
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress site
 
Custom Post Types in WP3
Custom Post Types in WP3Custom Post Types in WP3
Custom Post Types in WP3
 
Ajax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsAjax nested form and ajax upload in rails
Ajax nested form and ajax upload in rails
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
WordPress Theme Workshop: Sidebars
WordPress Theme Workshop: SidebarsWordPress Theme Workshop: Sidebars
WordPress Theme Workshop: Sidebars
 
Hooks WCSD12
Hooks WCSD12Hooks WCSD12
Hooks WCSD12
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
 
Pyimproved again
Pyimproved againPyimproved again
Pyimproved again
 

Mais de Brad Williams

From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015
From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015
From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015Brad Williams
 
Hiring Employee Number One: From Freelancer to Agency
Hiring Employee Number One: From Freelancer to AgencyHiring Employee Number One: From Freelancer to Agency
Hiring Employee Number One: From Freelancer to AgencyBrad Williams
 
Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014Brad Williams
 
How to Make a Native Mobile App with WordPress
How to Make a Native Mobile App with WordPressHow to Make a Native Mobile App with WordPress
How to Make a Native Mobile App with WordPressBrad Williams
 
Writing Secure WordPress Code
Writing Secure WordPress CodeWriting Secure WordPress Code
Writing Secure WordPress CodeBrad Williams
 
WordPress Security WordCamp OC 2013
WordPress Security WordCamp OC 2013WordPress Security WordCamp OC 2013
WordPress Security WordCamp OC 2013Brad Williams
 
Using WordPress as an Application Framework
Using WordPress as an Application FrameworkUsing WordPress as an Application Framework
Using WordPress as an Application FrameworkBrad Williams
 
Top Ten WordPress Security Tips for 2012
Top Ten WordPress Security Tips for 2012Top Ten WordPress Security Tips for 2012
Top Ten WordPress Security Tips for 2012Brad Williams
 
WordPress Security from WordCamp NYC 2012
WordPress Security from WordCamp NYC 2012WordPress Security from WordCamp NYC 2012
WordPress Security from WordCamp NYC 2012Brad Williams
 
WordPress for Beginners
WordPress for BeginnersWordPress for Beginners
WordPress for BeginnersBrad Williams
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress PluginBrad Williams
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
Spooky WordPress: Disturbingly Brilliant Uses of WP
Spooky WordPress: Disturbingly Brilliant Uses of WPSpooky WordPress: Disturbingly Brilliant Uses of WP
Spooky WordPress: Disturbingly Brilliant Uses of WPBrad Williams
 
WordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress SecurityWordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress SecurityBrad Williams
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Brad Williams
 
Top 20 WordPress Plugins You've Never Heard Of
Top 20 WordPress Plugins You've Never Heard OfTop 20 WordPress Plugins You've Never Heard Of
Top 20 WordPress Plugins You've Never Heard OfBrad Williams
 
WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010Brad Williams
 
WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009Brad Williams
 
Website Design Dos and Don’ts for a Successful Online Presence
Website Design Dos and Don’ts  for a Successful Online PresenceWebsite Design Dos and Don’ts  for a Successful Online Presence
Website Design Dos and Don’ts for a Successful Online PresenceBrad Williams
 

Mais de Brad Williams (20)

From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015
From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015
From Freelance to Agency: Hiring Employee Number One - WordCamp London 2015
 
Hiring Employee Number One: From Freelancer to Agency
Hiring Employee Number One: From Freelancer to AgencyHiring Employee Number One: From Freelancer to Agency
Hiring Employee Number One: From Freelancer to Agency
 
Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014
 
How to Make a Native Mobile App with WordPress
How to Make a Native Mobile App with WordPressHow to Make a Native Mobile App with WordPress
How to Make a Native Mobile App with WordPress
 
Writing Secure WordPress Code
Writing Secure WordPress CodeWriting Secure WordPress Code
Writing Secure WordPress Code
 
WordPress Security WordCamp OC 2013
WordPress Security WordCamp OC 2013WordPress Security WordCamp OC 2013
WordPress Security WordCamp OC 2013
 
Using WordPress as an Application Framework
Using WordPress as an Application FrameworkUsing WordPress as an Application Framework
Using WordPress as an Application Framework
 
Top Ten WordPress Security Tips for 2012
Top Ten WordPress Security Tips for 2012Top Ten WordPress Security Tips for 2012
Top Ten WordPress Security Tips for 2012
 
WordPress Security from WordCamp NYC 2012
WordPress Security from WordCamp NYC 2012WordPress Security from WordCamp NYC 2012
WordPress Security from WordCamp NYC 2012
 
WordPress Multisite
WordPress MultisiteWordPress Multisite
WordPress Multisite
 
WordPress for Beginners
WordPress for BeginnersWordPress for Beginners
WordPress for Beginners
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
Spooky WordPress: Disturbingly Brilliant Uses of WP
Spooky WordPress: Disturbingly Brilliant Uses of WPSpooky WordPress: Disturbingly Brilliant Uses of WP
Spooky WordPress: Disturbingly Brilliant Uses of WP
 
WordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress SecurityWordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress Security
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010
 
Top 20 WordPress Plugins You've Never Heard Of
Top 20 WordPress Plugins You've Never Heard OfTop 20 WordPress Plugins You've Never Heard Of
Top 20 WordPress Plugins You've Never Heard Of
 
WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010
 
WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009
 
Website Design Dos and Don’ts for a Successful Online Presence
Website Design Dos and Don’ts  for a Successful Online PresenceWebsite Design Dos and Don’ts  for a Successful Online Presence
Website Design Dos and Don’ts for a Successful Online Presence
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Surviving the Zombie Apocalypse using Custom Post Types and Taxonomies

  • 1. Surviving the Zombie Apocalypse using Custom Post Types and Taxonomies Brad Williams WebDevStudios.com @williamsba
  • 2. Who Am I? Brad Williams Co-Founder of WebDevStudios.com Co-Host SitePoint Podcast Co-Author of Professional WordPress (http://bit.ly/pro-wp) & Professional WordPress Plugin Development (http://amzn.to/plugindevbook)
  • 3. Topics  How to Kill Zombies
  • 4. Topics  How to Kill Zombies  Explain Custom Post Types and Taxonomies  Create Custom Post Types  Create Custom Taxonomies  Hooking into WordPress
  • 5. So What Are Custom Post Types?
  • 6. So What Are Custom Post Types? Post type refers to the various structured data that is maintained in the WordPress posts table.
  • 8. So What Are Custom Post Types Really? ENGLISH: Custom Post Types allow you to create different types of content in WordPress.
  • 9. Default WordPress Post Types: • Posts • Pages • Attachments • Revisions • Nav Menus
  • 10. Custom Post Type Ideas • Podcasts • Movies • Bars • Forum The • Quotes • Videos possibilities • Cars are endless! • House Listings • Events • Ticket System • etc, etc, etc
  • 11. To defeat your enemy you must know your enemy Tweet: @williamsba CAUTION ZOMBIES AHEAD! #wcraleigh Win a copy of Professional WordPress!
  • 12. To defeat your enemy you must know your enemy Type: Nerd Zombies Speed: Slow Favorite Body Part: Braaaaaains
  • 13. To defeat your enemy you must know your enemy Type: Nazi Zombies Speed: Fast Favorite Part: Buttocks
  • 14. To defeat your enemy you must know your enemy Type: Baby Zombies Speed: Crawl Favorite Part: Fingers
  • 15. To defeat your enemy you must know your enemy Type: Kitty Zombies Speed: Lightning Fast Favorite Part: Fingers
  • 16. Example: Drop the below code in your themes functions.php file <?php add_action( 'init', 'wc_raleigh_cpt_init' ); function wc_raleigh_cpt_init() { register_post_type( 'zombies' ); } ?>
  • 18. Example: Drop the below code in your themes functions.php file Where is it?
  • 19. Example: Set the public and label parameters for the custom post type <?php add_action( 'init', 'wc_raleigh_cpt_init' ); function wc_raleigh_cpt_init() { $arrrrgs = array( 'public' => true, 'label' => 'Zombies' ); register_post_type( 'zombies', $arrrrgs ); } ?>
  • 20. Example: It’s Alive! Our new “Zombies” post type is now visible in the WP dashboard!
  • 21. Example: Lets break it down: <?php 1. Action hook to trigger our function add_action( 'init', 'wc_raleigh_cpt_init' ); 2. Execute the register_post_type function wc_raleigh_cpt_init() { function defining zombies as our custom post type $arrrrgs = array( 'public' => true, 3. Set the label to Zombies 'label' => 'Zombies' ); 4. Set public to true. By default public is false which will hide your register_post_type( 'zombies', $arrrrgs ); post type } ?>
  • 23. Additional Arguments: labels An array of strings that represent your post type in the WP admin name: The plural form of the name of your post type. singular_name: The singular form of the name of your post type. add_new: The menu item for adding a new post. add_new_item: The header shown when creating a new post. edit_item: The header shown when editing a post. new_item: Shown in the favorites menu in the admin header. view_item: Shown alongside the permalink on the edit post screen. search_items: Button text for the search box on the edit posts screen. not_found: Text to display when no posts are found through search in the admin. not_found_in_trash: Text to display when no posts are in the trash. menu_name – Text used in the WP dashboard menu Ref: http://codex.wordpress.org/Function_Reference/register_post_type#Parameters
  • 24. Additional Arguments: labels An array of strings that represent your post type in the WP admin add_action( 'init', 'wc_raleigh_cpt_init' ); function wc_raleigh_cpt_init() { $labels = array( 'name' => 'Zombies', 'singular_name' => 'Zombie', 'add_new' => 'Add New Zombie', 'add_new_item' => 'Add New Zombie', 'edit_item' => 'Edit Zombie', 'new_item' => 'New Zombie', 'view_item' => 'View Zombie', 'search_items' => 'Search Zombies', 'not_found' => 'No zombies found', 'not_found_in_trash' => 'No zombies found in Trash', 'menu_name' => 'Zombies' ); $arrrrgs = array( 'public' => true, 'labels' => $labels ); register_post_type( 'zombies', $arrrrgs ); }
  • 26. Additional Arguments: supports Defines what meta boxes and other fields appear on the edit screen title: Text input field for the post title. editor: Main content meta box comments: Ability to turn comments on/off. trackbacks: Ability to turn trackbacks and pingbacks on/off. revisions: Allows revisions to be made of your post. author: Displays the post author select box. excerpt: A textarea for writing a custom excerpt. thumbnail: The post thumbnail (featured imaged) upload box. custom-fields: Custom fields input area. page-attributes: The attributes box shown for pages. Important for hierarchical post types, so you can select the parent post. post-formats: Add post formats
  • 27. Additional Arguments: supports Defines what meta boxes and other fields appear on the edit screen register_post_type('zombies', array( 'labels' => array( 'name' => 'Zombies', 'singular_name' => 'Zombie', 'add_new' => 'Add New Zombie', 'add_new_item' => 'Add New Zombie', 'edit' => 'Edit Zombies', 'edit_item' => 'Edit Zombie', 'new_item' => 'New Zombie', 'view' => 'View Zombie', 'view_item' => 'View Zombie', 'search_items' => 'Search Zombies', 'not_found' => 'No zombies found', 'not_found_in_trash' => 'No zombies found in Trash', 'parent' => 'Parent Zombie', ), 'supports' => array('title'), 'public' => true, ) );
  • 28. Additional Arguments: supports Defines what meta boxes and other fields appear on the edit screen Only the Title and Publish meta boxes are displayed
  • 29. Additional Arguments: supports Now lets activate all meta boxes $labels = array( 'name' => 'Zombies', 'singular_name' => 'Zombie', 'add_new' => 'Add New Zombie', 'add_new_item' => 'Add New Zombie', 'edit_item' => 'Edit Zombie', 'new_item' => 'New Zombie', 'view_item' => 'View Zombie', 'search_items' => 'Search Zombies', 'not_found' => 'No zombies found', 'not_found_in_trash' => 'No zombies found in Trash', 'menu_name' => 'Zombies' ); $arrrrgs = array( 'public' => true, 'labels' => $labels, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'post-formats' ) ); register_post_type( 'zombies', $arrrrgs );
  • 30. Additional Arguments: supports Now all meta boxes are displayed on the Zombie edit screen
  • 31. Additional Arguments: rewrite Defines the permalink structure of your custom post type posts slug: The slug to use in your permalink structure Example: 'rewrite' => array('slug' => 'enemy') BEFORE AFTER TIP: If you receive a 404 after setting a custom rewrite visit Settings > Permalinks and save your permalink settings to flush the rewrite rules in WordPress
  • 32. Additional Arguments: taxonomies Add pre-existing taxonomies to your custom post type Example: 'taxonomies' => array( 'post_tag', 'category')
  • 33. Additional Arguments: misc Below are additional arguments for creating custom post types hierarchical: whether the post type is hierarchical description: a text description of your custom post type show_ui: whether to show the admin menus/screens menu_position: Set the position of the menu order where the post type should appear menu_icon: URL to the menu icon to be used exclude_from_search: whether post type content should appear in search results can_export: Can this post type be exported show_in_menu: Whether to show the post type in an existing admin menu has_archive: Enables post type archives
  • 34. Additional Arguments: show_in_menu Add the custom post type to an existing menu 'show_in_menu' => 'edit.php?post_type=page' BEFORE AFTER
  • 35. Additional Arguments: has_archive Creates a default page to list all entries in a post type has_archive' => ‘enemies' http://example.com/enemies/ Now lists zombie posts Can also create a theme template named archive-zombies.php
  • 36. Putting it all together add_action( 'init', 'wc_raleigh_cpt_init' ); function wc_raleigh_cpt_init() { $labels = array( 'name' => 'Zombies', 'singular_name' => 'Zombie', 'add_new' => 'Add New Zombie', 'add_new_item' => 'Add New Zombie', 'edit_item' => 'Edit Zombie', 'new_item' => 'New Zombie', 'view_item' => 'View Zombie', 'search_items' => 'Search Zombies', 'not_found' => 'No zombies found', 'not_found_in_trash' => 'No zombies found in Trash', 'menu_name' => 'Zombies' ); $arrrrgs = array( 'public' => true, 'labels' => $labels, 'rewrite' => array('slug' => 'enemy'), 'taxonomies' => array( 'post_tag', 'category'), 'show_in_menu' => 'edit.php?post_type=page', 'has_archive' => 'enemies', 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'post-formats' ) ); register_post_type( 'zombies', $arrrrgs ); }
  • 37. Now that we know the enemy we must kill the enemy
  • 38. Zombie Weapons Type: Machete Nickname: Butter Cutter Gore Factor: Moderate Kill Speed: Swift
  • 39. Zombie Weapons Type: Spiked Bat Nickname: Pokie Gore Factor: Gore-cano Kill Speed: Slow
  • 40. Zombie Weapons Type: Chainsaw Nickname: Old Faithful Gore Factor: Over the Top Kill Speed: Slow and Steady
  • 41. Zombie Weapons Type: All in One Zombie Killer Nickname: The Torbert Gore Factor: Messy or Clean. You Choose! Kill Speed: Instant
  • 42. Weapons Custom Post Type Create another custom post type for Weapons $labels = array( 'name' => 'Weapons', 'singular_name' => 'Weapon', 'add_new' => 'Add New Weapon', 'add_new_item' => 'Add New Weapon', 'edit_item' => 'Edit Weapon', 'new_item' => 'New Weapon', 'view_item' => 'View Weapon', 'search_items' => 'Search Weapons', 'not_found' => 'No weapons found', 'not_found_in_trash' => 'No weapons found in Trash', 'menu_name' => 'Weapons' ); $arrrrgs = array( 'public' => true, 'labels' => $labels, 'rewrite' => array('slug' => 'weapon'), 'has_archive' => 'weapons', 'supports' => array( 'title', 'editor', 'thumbnail' ) ); register_post_type( 'weapons', $arrrrgs );
  • 43. So what are Taxonomies? ENGLISH: Taxonomies are a way to group similar items together
  • 44. Default WordPress Taxonomies: • Category • Tag • Link Category
  • 45. Example Time! Tweet: @williamsba ZOMBIES IN AREA! RUN #wcraleigh Win a copy of Professional WordPress!
  • 46. Example: Drop the below code in your themes functions.php file <?php $arrrrgs = array( 'label' => ‘Speed' ); register_taxonomy( ‘speed', 'zombies', $arrrrgs ); ?> Non-hierarchical Taxonomy
  • 47. Example: New custom taxonomy is automatically added to the Zombies post type menu The Speed meta box is also automatically added to the Zombie edit screen!
  • 48. Additional Arguments: hierarchical Give the custom taxonomy hierarchy ‘hierarchical' => true BEFORE AFTER
  • 49. Additional Arguments: labels An array of strings that represent your taxonomy in the WP admin name: The general name of your taxonomy singular_name: The singular form of the name of your taxonomy. search_items: The search items text popular_items: The popular items text all_items: The all items text parent_item: The parent item text. Only used on hierarchical taxonomies parent_item_colon: Same as parent_item, but with a colon edit_item: The edit item text update_item: The update item text add_new_item: The add new item text new_item_name: The new item name text separate_items_with_commas: The separate items with commas text add_or_remove_items: The add or remove items text choose_from_most_used: The choose from most used text menu_name: The string used for the menu name
  • 50. Additional Arguments: labels An array of strings that represent your taxonomy in the WP admin $labels = array( 'name' => 'Speed', 'singular_name' => 'Speed', 'search_items' => 'Search Speeds', 'all_items' => 'All Speeds', 'parent_item' => 'Parent Speed', 'parent_item_colon' => 'Parent Speed:', 'edit_item' => 'Edit Speed', 'update_item' => 'Update Speed', 'add_new_item' => 'Add New Speed', 'new_item_name' => 'New Genre Speed', 'menu_name' => 'Speed' ); $arrrrgs = array( 'hierarchical' => false, 'labels' => $labels ); register_taxonomy( 'speed', 'zombies', $arrrrgs );
  • 52. Additional Arguments: rewrite Defines the permalink structure for your custom taxonomy slug: The slug to use in your permalink structure Example: 'rewrite' => array( 'slug' => ‘quickness' ) BEFORE http://example.com/speed/ripe/ AFTER http://example.com/quickness/ripe/
  • 53. Additional Arguments: misc Below are additional arguments for creating custom taxonomies public: whether the taxonomy is publicly queryable show_ui: whether to display the admin UI for the taxonomy query_var: whether to be able to query posts using the taxonomy. show_tagcloud: whether to show a tag cloud in the admin UI show_in_nav_menus: whether the taxonomy is available for selection in nav menus
  • 54. Putting it all together $labels = array( 'name' => 'Speed', 'singular_name' => 'Speed', 'search_items' => 'Search Speeds', 'all_items' => 'All Speeds', 'parent_item' => 'Parent Speed', 'parent_item_colon' => 'Parent Speed:', 'edit_item' => 'Edit Speed', 'update_item' => 'Update Speed', 'add_new_item' => 'Add New Speed', 'new_item_name' => 'New Genre Speed', 'menu_name' => 'Speed' ); $arrrrgs = array( 'hierarchical' => false, 'labels' => $labels ); register_taxonomy( 'speed', 'zombies', $arrrrgs );
  • 55.
  • 57. Displaying Custom Post Type Content By default custom post type content will NOT display in the Loop <?php query_posts( array( 'post_type' => 'zombies' ) ); ?> Placing the above code directly before the Loop will only display our zombies
  • 58. Displaying Custom Post Type Content (After) BEFORE ZOMBIED <?php query_posts( array( 'post_type' => 'zombies' ) ); ?>
  • 59. Custom Loop Creating a custom Loop for your post type <?php $zombies = new WP_Query( array( 'post_type' => 'zombies', 'posts_per_page' => 1, 'orderby' => 'rand' ) ); while ( $zombies->have_posts() ) : $zombies->the_post(); the_title( '<h2><a href="' . get_permalink() . '" >', '</a></h2>' ); ?> <div class="entry-content"> <?php the_content(); ?> </div> <?php endwhile; ?>
  • 60. Custom Post Type Functions Function: get_post_type() Returns the post type of the content you are viewing <?php if (have_posts()) : while (have_posts()) : the_post(); $post_type = get_post_type( get_the_ID() ); if ($post_type == 'zombies') { echo 'This is a Zombie!'; } ?> <?php endwhile; ?> <?php endif; ?> http://codex.wordpress.org/Function_Reference/get_post_type
  • 61. Custom Post Type Functions Function: post_type_exists() Check if a post type exists if ( post_type_exists( 'zombies' ) ) { echo 'Zombies Exist!'; } Function: get_post_types() List all registered post types in WordPress $post_types = get_post_types( '','names' ); foreach ( $post_types as $post_type ) { echo '<p>'. $post_type. '</p>'; }
  • 62. Custom Taxonomy Functions Function: get_the_term_list() Display speed taxonomy for our zombies <?php echo get_the_term_list( $post->ID, speed', ‘Speed: ', ', ', '' ); ?> http://codex.wordpress.org/Function_Reference/get_the_term_list
  • 64. Custom Post Type UI Easily create custom post types without writing code! http://wordpress.org/extend/plugins/custom-post-type-ui/
  • 65. Custom Post Type UI Also easily create custom taxonomies without writing code! http://wordpress.org/extend/plugins/custom-post-type-ui/
  • 66. Custom Post Type UI Plugin also gives you the PHP code for custom post types and taxonomies! http://wordpress.org/extend/plugins/custom-post-type-ui/
  • 67. Custom Post Type and Taxonomy Resources  Related Codex Articles › http://codex.wordpress.org/Post_Types › http://codex.wordpress.org/Function_Reference/register_post_type › http://codex.wordpress.org/Taxonomies  Custom Post Type Articles › http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress › http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home- blog-page › http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/ › http://wpengineer.com/impressions-of-custom-post-type/ › http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/  Custom Taxonomies › http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28 › http://justintadlock.com/archives/2009/06/04/using-custom-taxonomies-to-create-a-movie- database › http://www.shibashake.com/wordpress-theme/wordpress-custom-taxonomy-input-panels
  • 68. Contact Brad Williams brad@webdevstudios.com Blog: strangework.com Twitter: @williamsba IRC: WDS-Brad http://amzn.to/plugindevbook http://bit.ly/pro-wp