Custom Post Types--Front End

10
Front End: Custom Post Types Do Something Useful

description

Learn how to use custom post types on the front end of your WordPress site.

Transcript of Custom Post Types--Front End

Page 1: Custom Post Types--Front End

Front End:Custom Post Types

D o S o m e t h i n g U s e f u l

Page 2: Custom Post Types--Front End

Staff Member Page

Commonly Requested

Not easy for non-technical users to create

Perfect situation for custom post types

Page 3: Custom Post Types--Front End

Create a page template

Below the loop run a query something like:

Option One

Page 4: Custom Post Types--Front End

Build On This

Let’s add a picture of the person:

Let’s set how much of their bio we want on the main listing page:

Page 5: Custom Post Types--Front End

Conditional Goodness

Display a job title only if it exists.

Looks to see if the custom field has a value. If it does, it displays that value.

Looks to see if the custom field has a value. If it does, it displays that value.

Can have multiple conditions and fallbacks.

Can have multiple conditions and fallbacks.

Page 6: Custom Post Types--Front End

Now We Can Tie In Our

Fields

Page 7: Custom Post Types--Front End
Page 8: Custom Post Types--Front End

A Bit OF Style

Page 9: Custom Post Types--Front End

Other CPT Display Options

CPT archive is now available with 3.1

Works like category archive

Call it archive-post-type-name.php

Also single-post-type-name.php

Page 10: Custom Post Types--Front End

About Bill Robbins

@billrobbins on Twitter

billrobbinsdesign.com

organizedthemes.com

[email protected]