Enable Topic Comments in Learndash Focus Mode
Enable Topic comments in Learndash Focus Mode

After upgrading to the Learndash v3 i was facing a big issue with the comments not being visible on any of the topics.
Even after adding a custom comments template in the theme it would still show the topic has no comments and after debugging for a while i disabled the focus mode and i was able to see all the comments.
But now i wanted the visual elements of the focus mode.
So i have resolved this for you. What Learndash is doing is its removing the topic comments at the ‘wp’ hook level with the function learndash_remove_comments.
In my case i did not want Learndash controlling the comments at all so this function worked exactly as i wanted it to.
You can copy the code below and paste it in your functions.php file of the theme.
add_action( 'wp', 'control_comments' ); function control_comments(){ remove_filter( 'comments_array', 'learndash_remove_comments', 1, 2 );
remove_filter('comments_open', 'learndash_comments_open', 10, 2); }
If the above code shows comments on Course or lesson pages then just disable the comments on them from the admin panel. (In my case they were already disabled for course and lesson post types)