Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BronsonQuick/1971046 to your computer and use it in GitHub Desktop.
Save BronsonQuick/1971046 to your computer and use it in GitHub Desktop.
A basic Testimonials Custom Post Type for WordPress
<?php add_action( 'init', 'sennza_register_cpt_testimonial' );
function sennza_register_cpt_testimonial() {
$args = array(
'public' => true,
'query_var' => 'testimonial',
'rewrite' => array(
'slug' => 'testimonials',
'with_front' => false
),
'supports' => array(
'title',
'editor',
'author',
'thumbnail',
'revisions'
),
'labels' => array(
'name' => 'Testimonials',
'singular_name' => 'Testimonial',
'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 );
}?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment