Skip to content

Instantly share code, notes, and snippets.

@lightningspirit
Created September 20, 2022 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lightningspirit/1a3456ac047db4e16b22b83caf5eed24 to your computer and use it in GitHub Desktop.
Save lightningspirit/1a3456ac047db4e16b22b83caf5eed24 to your computer and use it in GitHub Desktop.
Add excerpt to page

WordPress Page Excerpt

Add excerpt field to page

Usage

  1. Download this ZIP
  2. Upload to plugins
  3. Activate it
<?php
/**
* Plugin Name: Page Excerpt
* Plugin URI: https://gist.github.com/lightningspirit/1a3456ac047db4e16b22b83caf5eed24
* Description: Add excerpt to page
* Author: Move Your Digital, Inc.
* Author URI: https://moveyourdigital.com
* Version: 0.1.0
*
* @package WPGraphQL_JWT_Preview_Link
*/
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
add_action('init', function () {
add_post_type_support('page', 'excerpt');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment