I am attempting to ensure a widget is only loaded on blog post pages.
I tried using $post_type = get_post_type( $post_id );
inside the widget function of my widget class. However, upon loading pages like the homepage, 'archives', 'categories' etc. . . the post type is always 'post'. The only exception is when I create a page, it returns 'page' as expected.
Is there a way to actually ensure the current page is a post?