Text after more tag in posts

This will add your code after the more tag area on the post page:

add_filter('the_content', 'adds_block');

function adds_block($content) {
    if (is_single()) {
        // return $content;
        global $post;
        $thePostID = $post->ID;
        $test="<span id="more-" .$thePostID.'"></span>';
        return str_replace($test, ads(), $content);
    }
}

function ads(){
    return 'Your Custom Code,,';
}

Leave a Comment