Sarathlal N

Enable featured image in WordPress pages

In default, the featured image is only available for WordPress post.

But we can easily enable featured image for WordPress pages also. Just add below code snippet in to our theme’s / child theme’s functions.php file.

add_action( 'init', 'add_featured_image_to_pages' );
function add_featured_image_to_pages() {
 add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
}

 

Recent Posts

  1. Automating Release Generation with GitHub Actions
  2. WP CLI Commands to Bulk Delete Entries in WordPress Database
  3. Split a Single CSV File into Multiple Files Using the Split Command - Bash
  4. Migrating code repo from BitBucket to GitHub
  5. Streamlining Development - Our Journey with Git, Bitbucket, and Jira

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.