Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. /**
  2. * Register a custom post type called "book".
  3. *
  4. * @see get_post_type_labels() for label keys.
  5. */
  6. function intensiv_custom_post_type_gallery() {
  7. $labels = array(
  8. 'name' => _x( 'Galleries', 'Post type general name', textdomain' ),
  9. 'singular_name' => _x( 'Gallery', 'Post type singular name', 'textdomain' ),
  10. );
  11.  
  12. $args = array(
  13. 'labels' => $labels,
  14. 'public' => true,
  15. 'publicly_queryable' => true,
  16. 'show_ui' => true,
  17. 'show_in_menu' => true,
  18. 'query_var' => true,
  19. 'rewrite' => array( 'slug' => 'gallery' ),
  20. 'capability_type' => 'post',
  21. 'has_archive' => true,
  22. 'hierarchical' => false,
  23. 'menu_position' => null,
  24. 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
  25. );
  26.  
  27. register_post_type( 'gallery', $args );
  28. }
  29.  
  30. add_action( 'init', 'intensiv_custom_post_type_gallery' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement