Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. / Custom post type for products on sale and links-page
  2. add_action('init', 'create_posttype');
  3. function create_posttype() {
  4. register_post_type( 'sale',
  5. array(
  6. 'labels' => array(
  7. 'name' => __( 'Sale' ),
  8. 'singular_name' => __( 'Sale' )
  9. ),
  10. 'public' => true,
  11. 'has_archive' => true,
  12. 'rewrite' => array('slug' => 'sale'),
  13. 'taxonomies' => array('category', 'sale')
  14. ),
  15. register_post_type( 'links',
  16. array(
  17. 'labels' => array(
  18. 'name' => __( 'Links' ),
  19. 'singular_name' => __( 'Links' )
  20. ),
  21. 'public' => true,
  22. 'has_archive' => true,
  23. 'rewrite' => array('slug' => 'links'),
  24. 'supports' => array( 'title', 'editor', 'custom-fields' )
  25. )
  26. ));
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement