Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
ย
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.
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.