File: /var/www/laracopilot.stgviitor.com/laracopilot-wp/wp-content/themes/laracopilot/inc/cpt.php
<?php
/**
* Custom post types for LaraCopilot theme
*
* @package LaraCopilot
* @version 1.0.0
*/
/**
* Custom post type for features
*/
function laracopilot_register_feature_post_type() {
$args = array(
'label' => 'Features',
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => 'features'),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 5,
'menu_icon' => 'dashicons-star-filled',
'supports' => array('title', 'editor', 'thumbnail', 'excerpt'),
'labels' => array(
'name' => 'Features',
'singular_name' => 'Feature',
'menu_name' => 'Features',
'add_new' => 'Add New Feature',
'add_new_item' => 'Add New Feature',
'edit_item' => 'Edit Feature',
'new_item' => 'New Feature',
'view_item' => 'View Feature',
'search_items' => 'Search Features',
'not_found' => 'No features found',
'not_found_in_trash' => 'No features found in trash',
),
);
register_post_type('feature', $args);
}
add_action('init', 'laracopilot_register_feature_post_type');
/**
* Custom post type for testimonials
*/
function laracopilot_register_testimonial_post_type() {
$args = array(
'label' => 'Testimonials',
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => 'testimonials'),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 6,
'menu_icon' => 'dashicons-format-quote',
'supports' => array('title', 'editor', 'thumbnail'),
'labels' => array(
'name' => 'Testimonials',
'singular_name' => 'Testimonial',
'menu_name' => 'Testimonials',
'add_new' => 'Add New Testimonial',
'add_new_item' => 'Add New Testimonial',
'edit_item' => 'Edit Testimonial',
'new_item' => 'New Testimonial',
'view_item' => 'View Testimonial',
'search_items' => 'Search Testimonials',
'not_found' => 'No testimonials found',
'not_found_in_trash' => 'No testimonials found in trash',
),
);
register_post_type('testimonial', $args);
}
add_action('init', 'laracopilot_register_testimonial_post_type');