Top Banner
Front End: Custom Post Types Do Something Useful
10

Custom Post Types--Front End

Jun 19, 2015

Download

Technology

Bill Robbins

Learn how to use custom post types on the front end of your WordPress site.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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]