You just need to check for that custom field and return that instead of post content.
function displayCustomContent() {
if (!is_front_page()) return $content;
// how to replace main post content with custom content ?
global $post;
$special_content = get_post_meta($post->ID,'page_builder',true);
if (!empty($special_content)) {
// remove_all_filters('the_content');
return $special_content;
}
return $content;
}
The only other thing you might want to do is run your filter first…
add_filter('the_content', 'displayCustomContent', 1);
… and then uncomment remove_all_filters('the_content');
inside the callback function. That should reduce unnecessary overhead and also help to avoid having other content filters alter your content.