SlideShare a Scribd company logo
1 of 21
WP 101: Custom Fields& Custom Post
Types
Joe Querin – www.joequerin.com
WordCamp Kent – June 15, 2019
@joequerin joecue
joecue
{ Overview }
• Custom Fields vs Custom Post Types
• Ways to Customize WordPress
• What is CSS?
• Need more menus?
• Questions
{ Custom Post Types }
• WordPress stores all page and post data as a
post type.
• There are actually 5 core post types
• Post – Blog Entry
• Page – Static content
• Attachment – Document, Image, Video, etc.
• Revision – Version of a Post or Page
• Menu – Navigation/Menu Item
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.
Example Scenario
• 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!
{ Custom Post Types }
• WordPress allows you to create your own
custom post type.
• Allows you to format content in a particular
way.
• Recipes
• Products (non-ecommerce)
• Frequently Asked Questions
• Etc.
{ Custom Post Types }
function create_post_type() {
register_post_type( 'acme_product',
array(
'labels' => array(
'name' => __( 'Products' ),
'singular_name' => __( 'Product' )
),
'public' => true,
'has_archive' => true,
)
);
}
add_action( 'init', 'create_post_type' );
Sample code from https://codex.wordpress.org/Post_Types
{ Custom Post Types }
• Plugins
– Custom Post Types UI
• https://generatewp.com/
{ Custom Fields }
• The codex defines a custom field as meta-
data, that contains a key/value pair.
• ????
{ Custom Fields }
• I’ll 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
{ Custom Fields }
• What can you do with custom fields?
• Announcement features on your website
• First create a custom post type to handle the
announcement content
– Title
– Description
– Photo
• How about an announcement start date?
{ Custom Fields }
• Create a custom field
– Start Date – built in scheduling of Post
– Display End Date
– Importance
• Using some PHP logic we can display the
content we can make the post
automatically display based upon the
server’s date as well as when to stop.
{ Custom Fields }
• Using similar PHP logic, we can even
change the CSS class or ID of the
containing element to make the
announcement appear different.
{ Customize WP }
• WordPress Customizer
• Header Image
• Site Title / Tagline
• Colors
• Additional CSS
• Jetpack Plugin
• Additional CSS option
{ Customize WP }
• Page Builders
• Gutenberg
• Beaver Builder
• Bold Grid
• Divi
• Custom Field Plugins
{ Menus – More Menus }
• Adding new menus
• WP Dashboard
• Theme modification
• WP Dashboard
• Appearance -> Menu
• New Menu
• Add Menu Items
{ Menus – More Menus }
• Theme Function File
– Create Menu Definition
• Creates Menu Position
• Relevant Theme File
– Header.php
– Footer.php
– Sidebar.php, sidebar-_____.php
– Page.php
– Etc…
{ Menus – More Menus }
• Add wp_nav_menu() function call
wp_nav_menu( array(
'menu' => 'Top Navigation',
'sub_menu' => true
) );
{ Thanks! }
Joe Querin
www.joequerin.com
@joequerin
joecue
joecue

More Related Content

What's hot

Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Amanda Giles
 
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
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsAmanda Giles
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structurekeithdevon
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4David Bisset
 
TMW Code Club – Session 2 - CSS Basics
TMW Code Club – Session 2 - CSS BasicsTMW Code Club – Session 2 - CSS Basics
TMW Code Club – Session 2 - CSS Basicsnolly00
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme developmentThad Allender
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
WordPress Template Hierarchy
WordPress Template HierarchyWordPress Template Hierarchy
WordPress Template HierarchySarah Whinnem
 
Theme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgTheme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgThemeHorse
 
NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityMichelle Davies (Hryvnak)
 
Intro to jQuery for Drupal
Intro to jQuery for DrupalIntro to jQuery for Drupal
Intro to jQuery for Drupaljhamiltoorion
 
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1David Bisset
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and SecurityJoe Casabona
 

What's hot (20)

Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?
 
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
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4
 
Demystifying WordPress Conditional Tags
Demystifying WordPress Conditional TagsDemystifying WordPress Conditional Tags
Demystifying WordPress Conditional Tags
 
TMW Code Club – Session 2 - CSS Basics
TMW Code Club – Session 2 - CSS BasicsTMW Code Club – Session 2 - CSS Basics
TMW Code Club – Session 2 - CSS Basics
 
Intro to CSS Presentation
Intro to CSS PresentationIntro to CSS Presentation
Intro to CSS Presentation
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
Web101-intro
Web101-introWeb101-intro
Web101-intro
 
WordPress Template Hierarchy
WordPress Template HierarchyWordPress Template Hierarchy
WordPress Template Hierarchy
 
Theme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgTheme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.org
 
NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & Security
 
Intro to jQuery for Drupal
Intro to jQuery for DrupalIntro to jQuery for Drupal
Intro to jQuery for Drupal
 
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and Security
 

Similar to 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 TypesJoe Querin
 
WordPress 3 Custom Post Types
WordPress 3 Custom Post TypesWordPress 3 Custom Post Types
WordPress 3 Custom Post TypesDave Zille
 
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015Joe Querin
 
WordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-BetweenWordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-BetweenHeidi Cool
 
The WordPress University 2012
The WordPress University 2012The WordPress University 2012
The WordPress University 2012Stephanie Leary
 
Slides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks SitesSlides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks SitesMassimo Callisto
 
WordPress custom posts types for structured content
WordPress custom posts types for structured contentWordPress custom posts types for structured content
WordPress custom posts types for structured contentFirestorm Creative Studios
 
WordPress can do that?!
WordPress can do that?!WordPress can do that?!
WordPress can do that?!Scott McNulty
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme ReviewCatch Themes
 
Add Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress WebsiteAdd Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress WebsiteDustin Hartzler
 
WordPress Intermediate Workshop
WordPress Intermediate WorkshopWordPress Intermediate Workshop
WordPress Intermediate WorkshopThe Toolbox, Inc.
 
Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Stephanie Eckles
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post TypesK.Adam White
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design WorkshopFaye Tandog
 
Websites With Wordpress
Websites With WordpressWebsites With Wordpress
Websites With WordpressCharly Leetham
 
Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.Jacob Martella
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme developmentNaeem Junejo
 
Open Source CMS Playroom
Open Source CMS PlayroomOpen Source CMS Playroom
Open Source CMS Playroomlibrarywebchic
 
WordPress theme setting page
WordPress theme setting pageWordPress theme setting page
WordPress theme setting pageNaeem Junejo
 

Similar to WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields (20)

WP 101 - Custom Fields & Post Types
WP 101 - Custom Fields & Post TypesWP 101 - Custom Fields & Post Types
WP 101 - Custom Fields & Post Types
 
WordPress 3 Custom Post Types
WordPress 3 Custom Post TypesWordPress 3 Custom Post Types
WordPress 3 Custom Post Types
 
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
 
WordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-BetweenWordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-Between
 
The WordPress University 2012
The WordPress University 2012The WordPress University 2012
The WordPress University 2012
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
Slides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks SitesSlides 3 - Wordpress Networks Sites
Slides 3 - Wordpress Networks Sites
 
WordPress custom posts types for structured content
WordPress custom posts types for structured contentWordPress custom posts types for structured content
WordPress custom posts types for structured content
 
WordPress can do that?!
WordPress can do that?!WordPress can do that?!
WordPress can do that?!
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme Review
 
Add Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress WebsiteAdd Custom Post Types to Your WordPress Website
Add Custom Post Types to Your WordPress Website
 
WordPress Intermediate Workshop
WordPress Intermediate WorkshopWordPress Intermediate Workshop
WordPress Intermediate Workshop
 
Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design Workshop
 
Websites With Wordpress
Websites With WordpressWebsites With Wordpress
Websites With Wordpress
 
Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme development
 
Open Source CMS Playroom
Open Source CMS PlayroomOpen Source CMS Playroom
Open Source CMS Playroom
 
WordPress theme setting page
WordPress theme setting pageWordPress theme setting page
WordPress theme setting page
 

More from Joe Querin

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 PluginsJoe Querin
 
WP101 - Themes and Plugins
WP101 - Themes and PluginsWP101 - Themes and Plugins
WP101 - Themes and PluginsJoe Querin
 
WP 101 - WordPress Basics
WP 101 - WordPress BasicsWP 101 - WordPress Basics
WP 101 - WordPress BasicsJoe Querin
 
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?Joe Querin
 
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 PluginsJoe Querin
 
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 ...Joe Querin
 
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 BasicsJoe Querin
 
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 CodeJoe Querin
 
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 PluginJoe Querin
 
Building a WordPress Sandbox
Building a WordPress SandboxBuilding a WordPress Sandbox
Building a WordPress SandboxJoe Querin
 
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 platformJoe Querin
 
Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Joe 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 2012Joe Querin
 

More from Joe Querin (13)

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
 
Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015
 
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
 

Recently uploaded

Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfOndejSur
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkklolsDocherty
 
The Rise of Subscription-Based Digital Services.pdf
The Rise of Subscription-Based Digital Services.pdfThe Rise of Subscription-Based Digital Services.pdf
The Rise of Subscription-Based Digital Services.pdfe-Market Hub
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirtrahman018755
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebJie Liau
 
AI Generated 3D Models | AI 3D Model Generator
AI Generated 3D Models | AI 3D Model GeneratorAI Generated 3D Models | AI 3D Model Generator
AI Generated 3D Models | AI 3D Model Generator3DailyAI1
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresencePC Doctors NET
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appscristianmanaila2
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideVarun Mithran
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfappinfoedgeca
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxChloeMeadows1
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsrahman018755
 
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...APNIC
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsrahman018755
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.Tortogel
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsrahman018755
 

Recently uploaded (17)

Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
The Rise of Subscription-Based Digital Services.pdf
The Rise of Subscription-Based Digital Services.pdfThe Rise of Subscription-Based Digital Services.pdf
The Rise of Subscription-Based Digital Services.pdf
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirt
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
AI Generated 3D Models | AI 3D Model Generator
AI Generated 3D Models | AI 3D Model GeneratorAI Generated 3D Models | AI 3D Model Generator
AI Generated 3D Models | AI 3D Model Generator
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
GOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdfGOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdf
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirts
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 

WordCamp Kent 2019 - WP 101: Custom Post Type & Custom Fields

  • 1. WP 101: Custom Fields& Custom Post Types Joe Querin – www.joequerin.com WordCamp Kent – June 15, 2019 @joequerin joecue joecue
  • 2. { Overview } • Custom Fields vs Custom Post Types • Ways to Customize WordPress • What is CSS? • Need more menus? • Questions
  • 3. { Custom Post Types } • WordPress stores all page and post data as a post type. • There are actually 5 core post types • Post – Blog Entry • Page – Static content • Attachment – Document, Image, Video, etc. • Revision – Version of a Post or Page • Menu – Navigation/Menu Item
  • 4. 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.
  • 5. Example Scenario • You have populated your menu with all of your fantastic recipes. • Life is good!
  • 6. 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.
  • 7. Example Scenario • So you go to your site and check. Hmmm no menu…. • Then in 3…2…1.. You panic!
  • 8. { Custom Post Types } • WordPress allows you to create your own custom post type. • Allows you to format content in a particular way. • Recipes • Products (non-ecommerce) • Frequently Asked Questions • Etc.
  • 9. { Custom Post Types } function create_post_type() { register_post_type( 'acme_product', array( 'labels' => array( 'name' => __( 'Products' ), 'singular_name' => __( 'Product' ) ), 'public' => true, 'has_archive' => true, ) ); } add_action( 'init', 'create_post_type' ); Sample code from https://codex.wordpress.org/Post_Types
  • 10. { Custom Post Types } • Plugins – Custom Post Types UI • https://generatewp.com/
  • 11. { Custom Fields } • The codex defines a custom field as meta- data, that contains a key/value pair. • ????
  • 12. { Custom Fields } • I’ll 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. { Custom Fields } • What can you do with custom fields? • Announcement features on your website • First create a custom post type to handle the announcement content – Title – Description – Photo • How about an announcement start date?
  • 14. { Custom Fields } • Create a custom field – Start Date – built in scheduling of Post – Display End Date – Importance • Using some PHP logic we can display the content we can make the post automatically display based upon the server’s date as well as when to stop.
  • 15. { Custom Fields } • Using similar PHP logic, we can even change the CSS class or ID of the containing element to make the announcement appear different.
  • 16. { Customize WP } • WordPress Customizer • Header Image • Site Title / Tagline • Colors • Additional CSS • Jetpack Plugin • Additional CSS option
  • 17. { Customize WP } • Page Builders • Gutenberg • Beaver Builder • Bold Grid • Divi • Custom Field Plugins
  • 18. { Menus – More Menus } • Adding new menus • WP Dashboard • Theme modification • WP Dashboard • Appearance -> Menu • New Menu • Add Menu Items
  • 19. { Menus – More Menus } • Theme Function File – Create Menu Definition • Creates Menu Position • Relevant Theme File – Header.php – Footer.php – Sidebar.php, sidebar-_____.php – Page.php – Etc…
  • 20. { Menus – More Menus } • Add wp_nav_menu() function call wp_nav_menu( array( 'menu' => 'Top Navigation', 'sub_menu' => true ) );
  • 21. { Thanks! } Joe Querin www.joequerin.com @joequerin joecue joecue