Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. // == LANDING PAGES
  2. if ( ! function_exists('custom_post_type') ) {
  3.  
  4. // Register Custom Post Type
  5. function custom_post_type() {
  6.  
  7. $labels = array(
  8. 'name' => _x( 'Landing Pages', 'Post Type General Name', 'text_domain' ),
  9. 'singular_name' => _x( 'Landing Page', 'Post Type Singular Name', 'text_domain' ),
  10. 'menu_name' => __( 'Landing Pages', 'text_domain' ),
  11. 'name_admin_bar' => __( 'Landing Pages', 'text_domain' ),
  12. 'archives' => __( 'Landing Page Archives', 'text_domain' ),
  13. 'parent_item_colon' => __( 'Parent Landing Page:', 'text_domain' ),
  14. 'all_items' => __( 'All Landing Pages', 'text_domain' ),
  15. 'add_new_item' => __( 'Add New Landing Page', 'text_domain' ),
  16. 'add_new' => __( 'Add New', 'text_domain' ),
  17. 'new_item' => __( 'New Landing Page', 'text_domain' ),
  18. 'edit_item' => __( 'Edit Landing Page', 'text_domain' ),
  19. 'update_item' => __( 'Update Landing Page', 'text_domain' ),
  20. 'view_item' => __( 'View Landing Page', 'text_domain' ),
  21. 'search_items' => __( 'Search Landing Page', 'text_domain' ),
  22. 'not_found' => __( 'Not found', 'text_domain' ),
  23. 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
  24. 'featured_image' => __( 'Featured Image', 'text_domain' ),
  25. 'set_featured_image' => __( 'Set featured image', 'text_domain' ),
  26. 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
  27. 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),
  28. 'insert_into_item' => __( 'Insert into Landing Page', 'text_domain' ),
  29. 'uploaded_to_this_item' => __( 'Uploaded to this Landing Page', 'text_domain' ),
  30. 'items_list' => __( 'Landing Page list', 'text_domain' ),
  31. 'items_list_navigation' => __( 'Landing Page list navigation', 'text_domain' ),
  32. 'filter_items_list' => __( 'Filter Landing Page list', 'text_domain' ),
  33. );
  34. $rewrite = array(
  35. 'slug' => 'lp',
  36. 'with_front' => true,
  37. 'pages' => true,
  38. 'feeds' => false,
  39. );
  40. $args = array(
  41. 'label' => __( 'Landing Page', 'text_domain' ),
  42. 'description' => __( 'This is a collection of all the landing pages hosted on this website', 'text_domain' ),
  43. 'labels' => $labels,
  44. 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
  45. 'taxonomies' => array( 'link_category', 'post_format' ),
  46. 'hierarchical' => true,
  47. 'public' => true,
  48. 'show_ui' => true,
  49. 'show_in_menu' => true,
  50. 'menu_position' => 10,
  51. 'menu_icon' => 'dashicons-welcome-widgets-menus',
  52. 'show_in_admin_bar' => true,
  53. 'show_in_nav_menus' => true,
  54. 'can_export' => true,
  55. 'has_archive' => true,
  56. 'exclude_from_search' => true,
  57. 'publicly_queryable' => true,
  58. 'rewrite' => $rewrite,
  59. 'capability_type' => 'page',
  60. );
  61. register_post_type( 'landing_page_cpt', $args );
  62.  
  63. }
  64. add_action( 'init', 'custom_post_type', 0 );
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement