related_post_main

Action hook for related post main.

add_action('related_post_main','related_post_main_20200126');

function related_post_main_20200126() {

    ?>
    Custom HTML before related post area.
    <?php

}

View post on imgur.com

 

Remove default hook

add_action('related_post_main','related_post_main_remove_hook_20200126', 0);

function related_post_main_remove_hook_20200126() {

    remove_action('related_post_main','related_post_main_title');
    remove_action('related_post_main','related_post_main_post_loop');
    remove_action('related_post_main','related_post_main_css');
    remove_action('related_post_main','related_post_main_slider_scripts');

}

Remove related posts conditionally 

add_action('related_post_main' ,'related_post_main_hide');

function related_post_main_hide($atts){

    $post_id = isset($atts['post_id']) ? (int) $atts['post_id'] : get_the_ID();

    if($post_id == 896){
        remove_action('related_post_main','related_post_main_title');
        remove_action('related_post_main','related_post_main_post_loop');

    }

}