Attempt to read property “ID” on null”
Understanding: global $post The WordPress global variable $post, contains the data of the current post within the The Loop. WordPress will assign a value to this variable in each loop iteration. If you’re trying to access $post from outside the WP loop, it will be null or “”. You should be able to use the … Read more