I want to implement code on this link https://www.wpexplorer.com/wordpress-featured-image-url/
But when I try to run my code I get this error
PHP Fatal error: Call to undefined function wp_generate_attachment_metadata() in eval()'d code on line 48
File with this function included
// Include image.php require_once(ABSPATH . 'wp-admin/includes/image.php'); // Define attachment metadata $attach_data = wp_generate_attachment_metadata( $attach_id, $file );
and when I try to run
function_exists('wp_generate_attachment_metadata');
it returns true, but when I try to use it it shows me error.
1.4m articles
1.4m replys
5 comments
57.0k users