I have,
function my_function_init(){
global $post;
if(is_single()) {
echo $post->ID;
}
}
add_action('init', 'my_function_init');
this doesn’t work for me, it doesn’t recognize if its a post even if its a post (is_single() = checks if its a post), i have this in the plugin i am writing for wordpress, please help
I got it
the solution is
thats the fix 🙂