Custom Post type


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // create custom post type
  2. function create_my_slides_types(){
  3. register_post_type('slides',
  4. 'label' => __('Slides'),
  5. 'singular_label' => __('Slide'),
  6. 'public' => true,
  7. 'show_ui' => true,
  8. 'capability_type' => 'post',
  9. 'hierarchial' => false,
  10. 'supports' => array(
  11. 'title',
  12. 'editor',
  13. 'excerpt',
  14. 'custom-fields'
  15. ),
  16. 'rewrite' => array(
  17. 'slug' => 'slides',
  18. 'with_front' => false
  19. ),
  20. )
  21. );
  22.  
  23. }
  24. add_action( 'init', 'create_my_slides_types' );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.