Friday, March 15, 2024
Google search engine
HomeWordPressWP SnippetsHow to Add featured thumbnail to admin post columns

How to Add featured thumbnail to admin post columns

Adding this snippet to the functions.php of your WordPress theme will add the featured thumbnail to the post listing within the WordPress admin. This is a featured I added to my theme so that when creating posts I could more easily see what posts I had added thumbnails to.

add_filter('manage_posts_columns', 'posts_columns', 5); add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2); function posts_columns($defaults){ $defaults['admin_post_thumbs'] = __('Thumbs'); return $defaults; } function posts_custom_columns($column_name, $id){ if($column_name === 'admin_post_thumbs'){ echo the_post_thumbnail( 'featured-thumbnail' ); } } 
- Advertisment -
Google search engine

Most Popular

Top 10 Affiliate Programs

Best SEO Tools in the Market

What is Yii2 Framework?

Recent Comments