Insert ads below the title

I'm creating a plugin for insert ads. I want to insert ad below the title. I'm using the theme MH Magazine Lite

Im doing my plugin like this:

function diww_pre_content($content) {

    $pre_content = 'ads_up';
    $pre_content .= $content;
    return $pre_content;
}

add_filter( 'the_content', 'diww_pre_content' );

But, this shows the ad, below the feature image (inside the post) instead of title.

Any idea, how can i do that?

Thanks.

Topic ads plugins Wordpress

Category Web


You can use mh_post_header action hook to add your ads content after the post title. Check the following code snippet for help

add_action( 'mh_post_header', function() {
    echo 'Ads content goes here';
}, 5 );

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.