As user /u/majick suggests in the comments below: the better option may be after_setup_theme
which looks like this:
function theme_setup() {
add_theme_support( 'post-thumbnails' );
}
add_action( 'after_setup_theme', 'theme_setup' );
Another options is to use init
.
function theme_init() {
add_theme_support( 'post-thumbnails' );
}
add_action( 'init', 'theme_init' );
The init
hook explicitly states:
Fires after WordPress has finished loading but before any headers are sent.