How can I get the post id from within functions.php July 12, 2022 by Tarik Billa You can call “id” but object call as “ID” Please Replace with this code global $post ; $id = $post->ID ;