How to add an excerpt to pages and custom post types in WordPress
![](https://wpblockz.com/wp-content/uploads/2021/04/excerpts_pages_wordpress.png)
Share
Is an excerpt not showing for pages?
Excerpts are not supported by default for pages (it’s only a default feature for posts). You will not find excerpts under ‘screen options’ – you have to add support with code. To add support simply add the snippet below to your functions.php file.
add_action('after_setup_theme', function () {
add_post_type_support('page', 'excerpt');
});
Add support for custom post types
When registering a custom post type, you can add the option to have excerpts with the ‘supports’ parameter. But if you want to add excerpt support for an existing custom post type and you don’t have access to the register script, use the same function as above but replacing ‘page’ with the slug name of your custom post type.
add_action('after_setup_theme', function () {
add_post_type_support('your-custom-post-type', 'excerpt');
});
Read more tutorials
Top 50 WordPress Blogs to market your WordPress product (2024 edition)
Discover the top 50 WordPress blogs to market your WordPress product in 2024. Learn effective strategies and stay tuned for more tips on boosting your plugin, theme, or tool’s visibility.
Continue Reading Top 50 WordPress Blogs to market your WordPress product (2024 edition)
How to use multiple post types in a Query Loop Block
Currently the Query Loop only supports one post type. In this article we will show how we add multiple post types to query using the pre_get_posts action.
Continue Reading How to use multiple post types in a Query Loop Block
How to add filters and search to the WordPress Query Loop Block
It has been a pain to add filters and search to your feeds in Gutenberg. Not any more, we will teach you how.
Continue Reading How to add filters and search to the WordPress Query Loop Block