Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Register Custom Post Type
- function practice_area_cpt() {
- $labels = array(
- 'name' => 'Practice Areas',
- 'singular_name' => 'Practice Area',
- 'menu_name' => 'Practice Area',
- 'parent_item_colon' => 'Parent Practice Area:',
- 'all_items' => 'All Practice Areas',
- 'view_item' => 'View Practice Area',
- 'add_new_item' => 'Add New Practice Area',
- 'add_new' => 'New Practice',
- 'edit_item' => 'Edit Practice Area',
- 'update_item' => 'Update Practice Area',
- 'search_items' => 'Search Practice Areas',
- 'not_found' => 'No Practice Areas found',
- 'not_found_in_trash' => 'No Practice Areas found in Trash',
- );
- $rewrite = array(
- 'slug' => 'practice-area',
- 'with_front' => true,
- 'pages' => true,
- 'feeds' => true,
- );
- $args = array(
- 'label' => 'practice-area',
- 'description' => 'Practice Area pages',
- 'labels' => $labels,
- 'supports' => array( 'title', 'thumbnail' ),
- 'hierarchical' => true,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => false,
- 'show_in_nav_menus' => true,
- 'show_in_admin_bar' => false,
- 'menu_position' => 5,
- 'menu_icon' => '',
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'rewrite' => $rewrite,
- 'capability_type' => 'page',
- );
- register_post_type( 'practice-area', $args );
- }
- // Hook into the 'init' action
- add_action( 'init', 'practice_area_cpt' );
- // Register Custom Post Type
- function about_cpt() {
- $labels = array(
- 'name' => 'About Us',
- 'singular_name' => 'About',
- 'menu_name' => 'About',
- 'parent_item_colon' => 'Parent About:',
- 'all_items' => 'All About',
- 'view_item' => 'View About',
- 'add_new_item' => 'Add New About',
- 'add_new' => 'New About',
- 'edit_item' => 'Edit About',
- 'update_item' => 'Update About',
- 'search_items' => 'Search About page',
- 'not_found' => 'No About page found',
- 'not_found_in_trash' => 'No about pages found in Trash',
- );
- $rewrite = array(
- 'slug' => 'about',
- 'with_front' => true,
- );
- $args = array(
- 'label' => 'about',
- 'description' => 'About page',
- 'labels' => $labels,
- 'supports' => array( 'title', 'editor', 'thumbnail' ),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => false,
- 'show_in_nav_menus' => true,
- 'show_in_admin_bar' => false,
- 'menu_position' => 5,
- 'menu_icon' => '',
- 'can_export' => true,
- 'has_archive' => false,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'rewrite' => $rewrite,
- 'capability_type' => 'page',
- );
- register_post_type( 'about', $args );
- }
- // Hook into the 'init' action
- add_action( 'init', 'about_cpt' );
- function register_cpt_attorney() {
- $labels = array(
- 'name' => _x( 'Attorneys', 'attorney' ),
- 'singular_name' => _x( 'Attorney', 'attorney' ),
- 'add_new' => _x( 'Add New Attorneys', 'attorney' ),
- 'add_new_item' => _x( 'Add New Attorney', 'attorney' ),
- 'edit_item' => _x( 'Edit Attorney', 'attorney' ),
- 'new_item' => _x( 'New Attorney', 'attorney' ),
- 'view_item' => _x( 'View Attorney', 'attorney' ),
- 'search_items' => _x( 'Search Attorneys', 'attorney' ),
- 'not_found' => _x( 'No attorneys found', 'attorney' ),
- 'not_found_in_trash' => _x( 'No attorneys found in Trash', 'attorney' ),
- 'parent_item_colon' => _x( 'Parent Attorney:', 'attorney' ),
- 'menu_name' => _x( 'Attorneys', 'attorney' ),
- );
- $args = array(
- 'labels' => $labels,
- 'hierarchical' => false,
- 'description' => 'Your Attorney page(s).',
- 'supports' => array( 'thumbnail' ),
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => false,
- 'menu_position' => 5,
- 'show_in_nav_menus' => true,
- 'publicly_queryable' => true,
- 'exclude_from_search' => false,
- 'has_archive' => true,
- 'query_var' => true,
- 'can_export' => true,
- 'rewrite' => true,
- 'capability_type' => 'post'
- );
- register_post_type( 'attorney', $args );
- }
- add_action( 'init', 'register_cpt_attorney' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement