Please add follwing line of code in your theme’s function.php to display a new column which will display excerpt in your posts.
function pkb_get_excerpt($post_ID) {
$content_post = get_post($post_ID);
$content = $content_post->post_content;
if ($content) {
return $content;
}
}
// ADD NEW COLUMN
function pkb_columns_head($defaults) {
$defaults['excerpt'] = 'excerpt';
return $defaults;
}
// SHOW THE EXCERPT
function pkb_columns_content($column_name, $post_ID) {
if ($column_name == 'excerpt') {
$post_content = pkb_get_excerpt($post_ID);
echo $str1= substr ($post_content,0,50);
}
}
add_filter('manage_posts_columns', 'pkb_columns_head');
add_action('manage_posts_custom_column', 'pkb_columns_content', 10, 2);
Please feel free to ask if you have any queries.
Related Posts:
- GET the excerpt by ID
- How to end the excerpt with a sentence rather than a word?
- How To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts
- Modify ‘Read more’ link adding a new class
- How to Arrange Posts by Size in the WordPress Dashboard?
- Remove image caption from post excerpt
- How to add an admin function only to posts, not pages?
- How to customize read more link
- Custom wp_trim_words() function not trimming right
- Get all posts by post_author
- How to show post(excerpt) from specific category on wp page?
- How to link up “read more” on excerpts hack from WP Recipies
- Append Text to $post->post_excerpt
- Frontend Post Excerpt field mapping
- Allowing the SoundCloud player to appear in a post excerpt
- Auto Refresh Post List after X seconds
- How to show video from specific category on sidebar?
- How to show a full post, not just an excerpt
- Get post excerpt and title by specific post ID?
- Custom excerpt length filter doesn’t work
- Display most recent post in full, excerpts of older posts
- Modify WP_Post before processing
- Dashboard :10 Last draft page and 10 last pending review page (metabox)
- WordPress’ ALL post count info on its dashboard does not match phpMyAdmin’s ALL post count!
- Print a message if excerpt is empty after posts have been publish/update!
- get_the_excerpt() is not working as expected – returns wrong text
- After database migration, posts not showing up in dashboard
- How do I display some posts fully on the homepage, and some as an excerpt only?
- remove post and categories/tags count from right now dashboard widget
- How to display excerpt post on hamepage and archive pages?
- Develop Admin Panel Page
- How do you change the comment count in the back end posts list, to reflect unapproved comments, rather than all comments?
- Displaying post excerpt using wpdb query
- How to disable the_excerpt from one post
- The_excerpt() doesn’t parse – how to change that?
- Trying to edit archive.php to only show post extract, with featured image
- Show metabox value last post excerpt, title and link
- Hook for changing excerpt content when excerpt not set
- Change the number of excerpts displayed in search results layout
- the_excerpt is displaying excerpts of every post
- Why excerpt is Displaying same in Random Posts list
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- WordPress Excerpt Paragraph Limiting
- Grab value of excerpt_length
- Calling Permalinks With PHP
- I want to add another search box on posts page in dashboard
- How to Remove HTML Elements from Post Excerpt?
- How to add text before post_excerpt in Gutenberg
- Why is WordPress showing a blank excerpt for just one of my posts?
- Related post not showing table of content
- How to limit wordpress the_excerpt() dynamically
- How to view a post from the wordpress admin screen
- link to edit a post has empty target
- Moved a website and excerpts don’t work for old posts
- Enable HTML Tags in WordPress Post excerpt
- Very weird behaviour after removing WP pages
- Trim excerpt to first paragraph
- Nothing appears using get_the_excerpt() in category.php
- Get from the dashboard the ID of the current post being edited
- How to test if user is filtering post list in dashboard
- Hide Admin posts & pages in Dashboard
- Post List Widget with custom posts and editing the Read More Link
- Show category post with excerpt text
- Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)
- How can i show only 30% of the “the_content(“More…”)”?
- Creating / Editing a post from within site template
- How to get override the WP Admin Syndication feed limit for a custom feed?
- Using the_excerpt() some posts are truncated and some are not
- find view post hyperlink in PHP wordpress admin file
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- wp trim function not working
- excerpt in template for specific page
- Show full post only to loged-in users
- Allow User Can See His Post on his dashboard
- How do I save JS classes being applied to the WP dashboard via custom plugin?
- Read more opens attachment
- WordPress shows a count of published items on the site, but the items are not appearing when you click on the “published” link
- Change WordPress post-state in Admin Area
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- add image map script to post
- How to create shortcode to show the 2 latest posts
- Multiple authors for single post without plugin
- Author must complete profile info before they can publish a post?
- Advanced Custom Fields – Storing array value for further usage
- Check if post exists
- Alternate row and columns every X posts
- Duplicate posts and change category
- Removing noindex posts from wp_query
- Is there a PHP script to replace post date with updated modified date
- Post visibility based on user role
- Set static page/post from another blog on same network
- Why are my paginated posts always returning the same results?
- Output Post with ACF Fields into other Post
- Add delay to publish post
- Some custom post types did not return an object
- WordPress MySQL Search and replace with wildcard?
- How to display the pagination in my post list? [duplicate]
- alt of attached image in post / pages
- Display post in visual composer with custom html
- Custom post order returning posts from other categories