How to store functions in… functions.php?

Globals aren’t passed into functions. You have to declare them.

Change this:

function test() {
   return $post->ID; //or echo $post->ID;
}

…to this:

function test() {
   global $post;
   return $post->ID; //or echo $post->ID;
}

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduseduseduseduseduedueduedusedu