Wordpress custom-posttype

868 views
773 views

Published on

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
868
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Wordpress custom-posttype

  1. 1. CUSTOM POST TYPE IN WORDPRESS By: Junejo Naeem Ahmed
  2. 2. POST TYPES • WordPress can hold and display many different types of content. • A single item of such a content is generally called a post. • although post is also a specific post type. • Internally, all the post types are stored in the same place, in the wp_posts database table, but are differentiated by a column called post_type. • WordPress 3.0 gives you the capability to add your own custom post types and to use them in different ways.
  3. 3. DEFAULT POST TYPES • There are five post types that are readily available to users or internally used by the WordPress installation by default : – – – – – Post Page Attachment Revision Navigation menu
  4. 4. WHAT ACTUALLY ARE CUSTOM POST TYPES? • By using Custom Post Types you can create a new type of item like Posts and Pages, which will contain a different set of data. • It will have a new administration menu, dedicated editing pages, custom taxonomies and many more utilities required for full fledged publishing. • Custom Post Types are a new set of administrative options appearing along with the default post types such as Posts, Pages, Attachments etc.
  5. 5. WHAT ACTUALLY ARE CUSTOM POST TYPES? (cont’d) • A Custom Post Type can store any type of information. It has a dedicated editor, media uploader and uses the existing WordPress table structure for ease in data management. • The main advantage of creating custom post types using the WordPress API is that it equips itself well with existing themes and templates. • Custom Post Types are also SEO friendly because of their nifty permalinks.
  6. 6. WHAT ACTUALLY ARE CUSTOM POST TYPES? (cont’d)
  7. 7. CUSTOM POST TYPES • Custom post types are new post types you can create. • A custom post type can be added to WordPress via the register_post_type() function. • This function allows you to define a new post type by its labels, supported features, availability and other specifics. • Note that you must call register_post_type() before the admin_menu and after the after_setup_theme action hooks. • A good hook to use is the init hook.
  8. 8. WHAT WORDPRESS CAN DO FOR YOU NOW • You could create custom post types for books, movies, reviews, products and so on. • If created correctly, you can achieve the following with a few lines of code: • The custom post type will show up in the back end as a separate menu item with its own post list and “add new” page. • Categories and tags can be made available to the custom post type, or you can create custom taxonomies.
  9. 9. WHAT WORDPRESS CAN DO FOR YOU NOW • Apart from these, you can modify countless options, such as where the custom post type should be placed in the menu, should it be searchable, which user level can access it, should it be hierarchical, custom rewrite rules, etc. • Custom meta boxes enable you to add additional boxes to the edit screen of a post. They usually use custom fields, so you could just use custom fields as well, but by separating out some custom fields as meta boxes, you can create a much smoother and usable admin.
  10. 10. CUSTOM TAXONOMIES • Custom Taxonomies Your regular blog posts use categories and tags to create an organization structure. • However, the same organization doesn’t necessarily make sense for custom post types. • Your blog posts could be about your “Life,” your “Thoughts” or your “Dreams.” • These are obviously not appropriate for products.
  11. 11. CUSTOM TAXONOMIES (cont’d)

×