You can use the_content
filter if you need to modify the content:
add_filter( 'the_content', 'cyb_content_filter_callback' );
function cyb_content_filter_callback( $content ) {
// Only for singular post views and for posts of main loop
if( is_singular( 'post' ) && in_the_loop() ) {
// modify $content here
}
return $content;
}
If you need an action that runs before the post is displayed, maybe loop_start
is what you are looking for (not sure without knowing what exactly you need to do, but this action is the one that fires just before the post data is setup when the loop starts):
add_action( 'loop_start', 'cyb_loop_start_action_callback' );
function cyb_loop_start_action_callback( $wp_query ) {
// Only for singular post views and for posts of main loop
if( is_singular( 'post' ) && in_the_loop() ) {
// do something
}
}