My code is working fine on normal posts and pages but it is not working on custom posts. I could not find the answer.
I’ve created the custom post with Custom Post UI plugin.

Both filters the_content and the_title working fine on normal posts and pages but not working for custom post type.
My code is given blow. Please help.

function getAresDealDetails($content) {
    $custom_content = '';
    global $post;
    if ($post->post_type == "deal") {
        $custom_content = '1212';
    }
    $custom_content .= $content;
    return $custom_content;
}
add_filter('the_content', 'getAresDealDetails');

Read more here: the_content and the_title filter not working for custom post type created with custom post ui plugin


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , , , , ,

Wordpress related questions and answers: