Php error "Undefined variable:post" when using "get_post_thumbnail_id($post->ID)"
My guess would be that this code is in a function, like so:
function doSomething($someparams) { // ... $fotoer_recent_thumb = // ..... // ...}
In this case, $post
does not exist in this scope, and must be imported by adding the following line inside your function:
global $post;
Alternatively, and more cleanly, pass it as a parameter.