Function Reference/add post type support « WordPress Codex

Add support args to any post type:

Parameters

$post_type
(string) (required) Post type. (max. 20 characters)

Default: None
$supports
(string/array) (required) Feature to add.

  • ‘title’
  • ‘editor’ (content)
  • ‘author’
  • ‘thumbnail’ (featured image) (current theme must also support Post Thumbnails)
  • ‘excerpt’
  • ‘trackbacks’
  • ‘custom-fields’
  • ‘comments’ (also will see comment count balloon on edit screen)
  • ‘revisions’ (will store revisions)
  • ‘page-attributes’ (template and menu order) (hierarchical must be true) (the page template selector is only available for the page post type)
  • ‘post-formats’ add post formats, see Post Formats
Default: None

Example

This example adds support for excerpts in Pages (assuming it is *not* showing under “Screen Options”):


<?php
add_action('init', 'my_custom_init');
function my_custom_init() {
	add_post_type_support( 'page', 'excerpt' );
}
?>

Function Reference/add post type support « WordPress Codex.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.