SlideShare ist ein Scribd-Unternehmen logo
1 von 16
WP 201: Custom Post Types,
Custom Fields
WordCamp Columbus 2015 #wccbus | #wp201cp
 Before we describe what a custom post type is, let’s review what is
a post type?
 In WordPress there are 5 post types.
 Post – Blog Entry
 Page – Static Content that doesn’t expire or change.
 Attachment – Document, Image, Video, etc.
 Revision – Version of a Post or Page
 Navigation Menu Item
 A Custom Post Type, is one that you create!
What are Custom Post Types?
 Content that needs to be structured in a certain way, and you wish
to provide a template to ensure the content is always represented
the same.
 Examples:
 Recipes
 Products (non-ecommerce)
 Frequently Asked Questions
 etc.
Why create a Custom Post Type?
How Do I Create a Custom Post
Type?
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'acme_product',
array(
'labels' => array(
'name' => __( 'Products' ),
'singular_name' => __( 'Product' )
),
'public' => true,
'has_archive' => true,
)
);
}
Sample: https://codex.wordpress.org/Post_Types
 Where do I put the code?
 You could put the code in your themesfunctions.php file.
How Do I Create a Custom Post
Type?
Example Scenario
 Let’s say you have a food blog and you want to use a custom
post type to display your recipes.
 So you use the awesome code we just looked at, customized
it to represent your menu offerings. Created categories for
breakfast, lunch, dinner, appetizers, desserts.
 You have populated your menu with all of your fantastic
recipes.
 Life is good!
Example Scenario
 Now let’s say 3 months or 6 months, or maybe even a whole
year goes by, and everything is still good.
 Then you find the ultimate theme, it’s great, it looks just like
you want your website to look.
 So you install it, then you activate it.
 Then later that day or the next someone emails and asks
where are your recipes, so you tell them to click on recipes,
and they ask WHERE? I’m on your site and there are no
recipes.
Example Scenario
 So you go to your site and check. Hmmm no menu….
 Then in 3…2…1.. You panic!
 Where do I put the code?
 You could put the code in your themesfunctions.php file.
 A better place would be in a plugin!
 A plugin won’t cause your content to disappear.
 How do I create a plugin?
How Do I Create a Custom Post
Type?
Code Demo
What is a Custom Field?
 The Codex defines a custom field as meta-data, that contains
a key/value pair.
 ??????
What is a Custom Field?
 Even I admit it’s pretty technical and confusing.
 If you keep reading the codex page though you’ll see what a
key/value pair is.
 Key – the name of the meta-data
 Value – the meta-data
 Example:
 Key: Currently Reading
 Value: Calvin and Hobbes
What can I do with a Custom
Field?
 You need a feature for your website, such as
announcements.
 First you create a custom post type to handle the
announcement content.
 Title
 Description
 Photo
 It would be cool if I could make announcements appear
automatically on a certain date and disappear automatically
on a certain date.
What can I do with a Custom
Field?
 Create a custom field
 Start Date – built in scheduling of post
 Display End Date
 Importance
 Using some PHP logic when displaying the content we can
automatically display based upon the server’s date the
content, as well as stop displaying it.
 Using similar PHP logic, we can change the CSS class or ID
of the containing element to make the announcement stand
out.
Code Demo
Links Mentioned
 www.generatewp.com – various form based generators for
code snippets in WordPress
 WP Beginner – Site Specific plugin –
http://www.wpbeginner.com/beginners-guide/what-why-and-
how-tos-of-creating-a-site-specific-wordpress-plugin/
 Recipe Custom Post Type Example –
https://gist.github.com/joecue/d0a5e37f3d1bbe17ae1f
 Announcement Custom Field (Meta Box) and Custom Post
Type Example –
https://gist.github.com/joecue/7d2339e4e9a8b16ab0a4

Weitere ähnliche Inhalte

Was ist angesagt?

WP Style Guide Sep 23 2009.pptx
WP Style Guide Sep 23 2009.pptxWP Style Guide Sep 23 2009.pptx
WP Style Guide Sep 23 2009.pptx
nickohrn
 

Was ist angesagt? (19)

WordPress SEO & Optimisation
WordPress SEO & OptimisationWordPress SEO & Optimisation
WordPress SEO & Optimisation
 
Wp snapper review
Wp snapper reviewWp snapper review
Wp snapper review
 
Instagram filters
Instagram filters Instagram filters
Instagram filters
 
Blogging for champions
Blogging for championsBlogging for champions
Blogging for champions
 
Alicia Lyttle & Lorette Lyttle of Monetized Marketing - WordPress Wednesday –...
Alicia Lyttle & Lorette Lyttle of Monetized Marketing - WordPress Wednesday –...Alicia Lyttle & Lorette Lyttle of Monetized Marketing - WordPress Wednesday –...
Alicia Lyttle & Lorette Lyttle of Monetized Marketing - WordPress Wednesday –...
 
Blogging for business
Blogging for businessBlogging for business
Blogging for business
 
WordPress plugin development
WordPress plugin developmentWordPress plugin development
WordPress plugin development
 
WP Style Guide Sep 23 2009.pptx
WP Style Guide Sep 23 2009.pptxWP Style Guide Sep 23 2009.pptx
WP Style Guide Sep 23 2009.pptx
 
WordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress OptimizationWordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress Optimization
 
Blogging 101, VT HRC
Blogging 101, VT HRCBlogging 101, VT HRC
Blogging 101, VT HRC
 
Rock Your Blocks! Web Design Acceleration with Genesis Pro
Rock Your Blocks! Web Design Acceleration with Genesis ProRock Your Blocks! Web Design Acceleration with Genesis Pro
Rock Your Blocks! Web Design Acceleration with Genesis Pro
 
Advanced custom fields in Wordpress
Advanced custom fields in WordpressAdvanced custom fields in Wordpress
Advanced custom fields in Wordpress
 
Child Theme
Child ThemeChild Theme
Child Theme
 
10 Steps to Becoming a WordPress Theme Ninja
10 Steps to Becoming a WordPress Theme Ninja10 Steps to Becoming a WordPress Theme Ninja
10 Steps to Becoming a WordPress Theme Ninja
 
What to include in a boilerplate theme
What to include in a boilerplate themeWhat to include in a boilerplate theme
What to include in a boilerplate theme
 
Between a Block & a Hard Place
Between a Block & a Hard PlaceBetween a Block & a Hard Place
Between a Block & a Hard Place
 
Web development basics2
Web development basics2Web development basics2
Web development basics2
 
SEO Mistakes
SEO MistakesSEO Mistakes
SEO Mistakes
 
Permalink
PermalinkPermalink
Permalink
 

Andere mochten auch

Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
Joey Kudish
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
K.Adam White
 

Andere mochten auch (20)

Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015
 
Custom Post Types--Front End
Custom Post Types--Front EndCustom Post Types--Front End
Custom Post Types--Front End
 
Advanced Custom Post Types
Advanced Custom Post TypesAdvanced Custom Post Types
Advanced Custom Post Types
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
 
Custom Post Types and Taxonomies
Custom Post Types and TaxonomiesCustom Post Types and Taxonomies
Custom Post Types and Taxonomies
 
A/B Testing: Make your wildest conversion goals come true
A/B Testing: Make your wildest conversion goals come trueA/B Testing: Make your wildest conversion goals come true
A/B Testing: Make your wildest conversion goals come true
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
 
Nate Reist WCGR WP AJAX presentation
Nate Reist WCGR WP AJAX presentationNate Reist WCGR WP AJAX presentation
Nate Reist WCGR WP AJAX presentation
 
Angular js introduction by Tania Gonzales
Angular js introduction by Tania GonzalesAngular js introduction by Tania Gonzales
Angular js introduction by Tania Gonzales
 
The Future of WordPress and JavaScript
The Future of WordPress and JavaScriptThe Future of WordPress and JavaScript
The Future of WordPress and JavaScript
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
Curso AngularJS - 1. introducción
Curso AngularJS - 1. introducciónCurso AngularJS - 1. introducción
Curso AngularJS - 1. introducción
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a Backend
 
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
 
WordPress Custom Post Types
WordPress Custom Post TypesWordPress Custom Post Types
WordPress Custom Post Types
 
Introducción a Angular JS
Introducción a Angular JSIntroducción a Angular JS
Introducción a Angular JS
 
Building a JavaScript App powered by WordPress & AngularJS
Building a JavaScript App powered by WordPress & AngularJSBuilding a JavaScript App powered by WordPress & AngularJS
Building a JavaScript App powered by WordPress & AngularJS
 
Webinar: AngularJS and the WordPress REST API
Webinar: AngularJS and the WordPress REST APIWebinar: AngularJS and the WordPress REST API
Webinar: AngularJS and the WordPress REST API
 
Angular js
Angular jsAngular js
Angular js
 
Introduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress DevelopersIntroduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress Developers
 

Ähnlich wie WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015

WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
Denise Williams
 

Ähnlich wie WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015 (20)

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...
 
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom FieldsWordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields
 
WP 101 - Custom Fields & Post Types
WP 101 - Custom Fields & Post TypesWP 101 - Custom Fields & Post Types
WP 101 - Custom Fields & Post Types
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
 
Introduction to Freelance Writing
Introduction to Freelance WritingIntroduction to Freelance Writing
Introduction to Freelance Writing
 
Introduction to Freelance Writing
Introduction to Freelance WritingIntroduction to Freelance Writing
Introduction to Freelance Writing
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
SEO for WordPress Blogs
SEO for WordPress BlogsSEO for WordPress Blogs
SEO for WordPress Blogs
 
The WordPress Author
The WordPress AuthorThe WordPress Author
The WordPress Author
 
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
 
7 steps
7 steps7 steps
7 steps
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
Spencer Nash - Advanced Custom Fields
Spencer Nash - Advanced Custom FieldsSpencer Nash - Advanced Custom Fields
Spencer Nash - Advanced Custom Fields
 
WordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesWordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child Themes
 
Create and publish an optimized blog post to WordPress
Create and publish an optimized blog post to WordPressCreate and publish an optimized blog post to WordPress
Create and publish an optimized blog post to WordPress
 
Wordpress course
Wordpress courseWordpress course
Wordpress course
 
W pthemes
W pthemesW pthemes
W pthemes
 
Blogging 101 Guide
Blogging 101 GuideBlogging 101 Guide
Blogging 101 Guide
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
Blogging Basics
Blogging BasicsBlogging Basics
Blogging Basics
 

Mehr von Joe Querin

Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
Joe Querin
 

Mehr von Joe Querin (12)

WP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and PluginsWP 101 - Local Development - Themes and Plugins
WP 101 - Local Development - Themes and Plugins
 
WP101 - Themes and Plugins
WP101 - Themes and PluginsWP101 - Themes and Plugins
WP101 - Themes and Plugins
 
WP 101 - WordPress Basics
WP 101 - WordPress BasicsWP 101 - WordPress Basics
WP 101 - WordPress Basics
 
WordCamp Kent 2019 - WP 101: Guten.. What?
WordCamp Kent 2019 - WP 101: Guten.. What?WordCamp Kent 2019 - WP 101: Guten.. What?
WordCamp Kent 2019 - WP 101: Guten.. What?
 
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
WordCamp Kent 2019 - WP 101: Local Development - Themes and PluginsWordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
 
WordCamp Kent 2019 - WP 101: Themes & Plugins: What are they, and where do I ...
WordCamp Kent 2019 - WP 101: Themes & Plugins: What are they, and where do I ...WordCamp Kent 2019 - WP 101: Themes & Plugins: What are they, and where do I ...
WordCamp Kent 2019 - WP 101: Themes & Plugins: What are they, and where do I ...
 
WordCamp Kent 2019 - WP 101: WordPress Basics
WordCamp Kent 2019 - WP 101: WordPress BasicsWordCamp Kent 2019 - WP 101: WordPress Basics
WordCamp Kent 2019 - WP 101: WordPress Basics
 
One Plugin to Rule All Your Custom Code
One Plugin to Rule All Your Custom CodeOne Plugin to Rule All Your Custom Code
One Plugin to Rule All Your Custom Code
 
Why & How to Create a WordPress Plugin
Why & How to Create a WordPress PluginWhy & How to Create a WordPress Plugin
Why & How to Create a WordPress Plugin
 
Building a WordPress Sandbox
Building a WordPress SandboxBuilding a WordPress Sandbox
Building a WordPress Sandbox
 
Using WordPress as a web application platform
Using WordPress as a web application platformUsing WordPress as a web application platform
Using WordPress as a web application platform
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015

  • 1. WP 201: Custom Post Types, Custom Fields WordCamp Columbus 2015 #wccbus | #wp201cp
  • 2.  Before we describe what a custom post type is, let’s review what is a post type?  In WordPress there are 5 post types.  Post – Blog Entry  Page – Static Content that doesn’t expire or change.  Attachment – Document, Image, Video, etc.  Revision – Version of a Post or Page  Navigation Menu Item  A Custom Post Type, is one that you create! What are Custom Post Types?
  • 3.  Content that needs to be structured in a certain way, and you wish to provide a template to ensure the content is always represented the same.  Examples:  Recipes  Products (non-ecommerce)  Frequently Asked Questions  etc. Why create a Custom Post Type?
  • 4. How Do I Create a Custom Post Type? add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'acme_product', array( 'labels' => array( 'name' => __( 'Products' ), 'singular_name' => __( 'Product' ) ), 'public' => true, 'has_archive' => true, ) ); } Sample: https://codex.wordpress.org/Post_Types
  • 5.  Where do I put the code?  You could put the code in your themesfunctions.php file. How Do I Create a Custom Post Type?
  • 6. Example Scenario  Let’s say you have a food blog and you want to use a custom post type to display your recipes.  So you use the awesome code we just looked at, customized it to represent your menu offerings. Created categories for breakfast, lunch, dinner, appetizers, desserts.  You have populated your menu with all of your fantastic recipes.  Life is good!
  • 7. Example Scenario  Now let’s say 3 months or 6 months, or maybe even a whole year goes by, and everything is still good.  Then you find the ultimate theme, it’s great, it looks just like you want your website to look.  So you install it, then you activate it.  Then later that day or the next someone emails and asks where are your recipes, so you tell them to click on recipes, and they ask WHERE? I’m on your site and there are no recipes.
  • 8. Example Scenario  So you go to your site and check. Hmmm no menu….  Then in 3…2…1.. You panic!
  • 9.  Where do I put the code?  You could put the code in your themesfunctions.php file.  A better place would be in a plugin!  A plugin won’t cause your content to disappear.  How do I create a plugin? How Do I Create a Custom Post Type?
  • 11. What is a Custom Field?  The Codex defines a custom field as meta-data, that contains a key/value pair.  ??????
  • 12. What is a Custom Field?  Even I admit it’s pretty technical and confusing.  If you keep reading the codex page though you’ll see what a key/value pair is.  Key – the name of the meta-data  Value – the meta-data  Example:  Key: Currently Reading  Value: Calvin and Hobbes
  • 13. What can I do with a Custom Field?  You need a feature for your website, such as announcements.  First you create a custom post type to handle the announcement content.  Title  Description  Photo  It would be cool if I could make announcements appear automatically on a certain date and disappear automatically on a certain date.
  • 14. What can I do with a Custom Field?  Create a custom field  Start Date – built in scheduling of post  Display End Date  Importance  Using some PHP logic when displaying the content we can automatically display based upon the server’s date the content, as well as stop displaying it.  Using similar PHP logic, we can change the CSS class or ID of the containing element to make the announcement stand out.
  • 16. Links Mentioned  www.generatewp.com – various form based generators for code snippets in WordPress  WP Beginner – Site Specific plugin – http://www.wpbeginner.com/beginners-guide/what-why-and- how-tos-of-creating-a-site-specific-wordpress-plugin/  Recipe Custom Post Type Example – https://gist.github.com/joecue/d0a5e37f3d1bbe17ae1f  Announcement Custom Field (Meta Box) and Custom Post Type Example – https://gist.github.com/joecue/7d2339e4e9a8b16ab0a4