If you want to enable excerpt for specific page, then you can add some conditions to narrow down.
For check “front page id” you can use get_option('page_on_front');
in admin area. (is_front_page()
should not work here)
global $pagenow;
// check current screen is edit page
if ( $pagenow == 'post.php' ) {
$fron_page_id = get_option('page_on_front');
$current_page = $_GET['post'];
// check current page is match with front page
if($fron_page_id == $current_page){
add_post_type_support('page','excerpt');
}
}
Related Posts:
- How to find cause of PHP notices with no stack trace?
- The correct method to pass query vars in AJAX using ajaxurl
- Display user’s total comment count outside The Loop
- Getting the action’s tag name within the action
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- How to add query vars with paginated URLs?
- wordpress separate registration for different roles
- How to get user by display_name with WP_User_Query
- Changing Link Attributes for Wp_Link_Pages
- Problem with Woocommerce REST API Authentication
- How to get custom image size for image uploaded in Customizer
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- How to change
- Get only the grandchildren, not the direct children of page/current page?
- Passing POST data from one WP post to another
- Use wp_remote_get to get JSON instagram feed from public profile
- How to add SVG icon above product tab title
- WP_Query sort using multiple numeric meta values
- Call to undefined function issue
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- How can I generate random numbers inside my shortcodes on each implementation?
- custom widget on the footer
- How to create a custom category of wordpress admin
- WordPress automatically adding html tag around PHP code
- WordPress does not load page.php, return 404.php
- Converting HTML Template to WordPress Theme
- How to hide all child pages with post_query?
- PHP Warning: chmod(): Operation not permitted in class-wp-filesystem-direct.php on line 173
- Saving an array of dynamic repeater data as post_meta
- How can I apply_filters from inside a function?
- Image rotation and editing stopped working in WordPress after upgrading Ubuntu from 16.04 to 18.04
- WordPress asks you for your FTP details if you want to run Automatic Updates/Upgrade Plugins
- Populate editor with some content of a page with a page template
- I want to load in a new class but only if the current page is single-movies.php
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Skt full width basic slideshow problem
- RTL Stylesheet Confusion with WordPress
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- get_template_part() not firing within a switch statement when template has new WP_Query
- How to show/hide php table rows based on the content of custom fields
- How to determine from a different folder (outside wordpress) if a visitor is logged into WordPress
- get comment data using comment id
- how to get serialized post meta
- Scheduling an event inside plugin class is not working
- How to catch wordpress post ID when it’s published
- WP check_ajax_referer() is not working
- How to access or parse key/values that have “string”
- Will I have problem with PHP 5.5 and WordPress 4.9.4?
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- How do i wrap woocomerce attribute in list?
- Removing files programmatically
- Trying to run website a php file is blank
- Class property seems to lose scope, attached to save_post action?
- exclude custom post type from running a function
- Create condition for Author bio Social Links
- WordPress – Get Posts with Category data
- Call to “admin_notices” hook from a static method
- How to Create custom block for displaying information in content section which act like shortcode
- How to use Page link field with is_page()
- wp_query – Exclude the first thumbnail from lazy loading on archives
- Running SMTP Conditionally
- Change lost password url to a mailto URL in WordPress
- Usermeta data unserialize, extract and display in table in WordPress
- Trying to show the category of a post in the post display
- Displaying SQL query result from user input via wpdb
- Display specific page if user signed in
- 500 Error, Get custom field and returning it
- How do I add this OnClick event script to a custom button I’ve created?
- How can i limit the number of posts to the most recent 6 in my query?
- wordpress dependent dropdownlist using post type is not working
- Post content, PHP help
- How to insert text into post based on category – via single.php file
- Access certain Entry in HTML-Table and pass the entry-data in WP not working [closed]
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- I want url from a file in media using title file
- how to get buddy press messages based on thready_id?
- Widget Logic – display on page and all child
- How to associate dynamic PHP page for chosen WordPress tag?
- Child theme functions.php file change database entries
- Get dimensions of logo
- How to call javascript function (jquery) in a shortcode?
- Add custom filter to register data in array
- Rename Index.php
- Why does WP_Query show only the same post even with different categories and endwhile?
- Run A Pre-Built Core PHP Application Under A WordPress Page or Post Route
- show/hide attachments
- How to display different widgets on specific pages, hide from other pages
- Cross origin ajax request always returns 0 when calling get_current_user_id();
- How to print array of specific item
- js code not stored in database currectly
- echo php values in table – strange behaviour, not all values are shown
- Import users and custom user meta from csv
- Gutenberg – render_callback does not pass ToggleControl value on frontend
- Remove post image caption from post_excerpt();
- Prevent users from display default wordpress login form
- Creating a table via dbDelta
- wpbd to connect to a VPS mysql database
- Count custom posts type and filter by tag
- Error with PHP 8
- How to create a User Role and give permission to only use Web Stories plugin?