Support » Themes and Templates » Excerpt Custom Post Type

  • Resolved joshrodgers


    I have the following code for my custom post type:

    Line 10 is the Supports section of my custom post type. I have excerpt listed as something that is supported by my custom post type.

    By default, this box is displayed directly under the editor. Is there any way to keep support for the excerpt, but only have it shown if its checked in the “Screen Options” tab?


Viewing 1 replies (of 1 total)
  • This code goes in your functions file:

    All you have to do is change “frog” on line 4 to match your custom post type name. *If you just want it for normal posts change “Frog” to “post”.

    By default WordPress will not show anything in the array on line 5…so…if I wanted to hide my excerpt I would remove postexcerpt from the array.

    That’s it!! 🙂

    NOTE: This sets the default screen options, so if you have changed the options you may have to change the name of your custom post type or clean your database in order for the code to work.

Viewing 1 replies (of 1 total)
  • The topic ‘Excerpt Custom Post Type’ is closed to new replies.