Answers for "excerpt custom post type"

PHP
0

excerpt custom post type

Change your support field to this 
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ) );

Eg:
<?php
add_action( 'init', 'create_testimonial_posttype' );
function create_testimonial_posttype(){
  register_post_type( 'testimonials',
    array(
      'labels' => array(
        'name' => __( 'Testimonials' ),
        'singular_name' => __( 'Testimonial' )
      ),
      'public' => true,
      'has_archive' => true,
      'rewrite' => array('slug' => 'clients'),
      'supports' => array('title','thumbnail','editor','page-attributes','excerpt'),
    )
  );
}
?>
Posted by: Guest on January-20-2021

Browse Popular Code Answers by Language