From 33f50fc69c833721563fe4be2d9921fb031f167d Mon Sep 17 00:00:00 2001 From: Nikhil Date: Tue, 6 Mar 2018 16:52:15 +0530 Subject: [PATCH] Fix: don't include learndash's content on the page when custom template is being rendered Hide the button and course details using CSS --- classes/class-ctlearndash.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/classes/class-ctlearndash.php b/classes/class-ctlearndash.php index 2bbed94..d54c64f 100644 --- a/classes/class-ctlearndash.php +++ b/classes/class-ctlearndash.php @@ -234,9 +234,15 @@ public function enqueue_scripts() { // Custom CSS to hide elements from LearnDash when a custom template is used. $css = ' - .custom-template-lifterlms :not(.custom-template-learndash-content) .btn-join, - .custom-template-lifterlms :not(.custom-template-learndash-content) #learndash_course_status, - .custom-template-lifterlms :not(.custom-template-learndash-content) #learndash_course_materials { + .custom-template-lifterlms .custom-template-learndash-content .btn-join, + .custom-template-lifterlms .custom-template-learndash-content #learndash_course_status, + .custom-template-lifterlms .custom-template-learndash-content #learndash_course_materials { + display: initial; + } + + .custom-template-lifterlms .btn-join, + .custom-template-lifterlms #learndash_course_status, + .custom-template-lifterlms #learndash_course_materials { display: none; } '; @@ -278,7 +284,7 @@ public function override_template_include() { */ public function render( $content ) { - $content .= '
'; + $content = '
'; $template = get_course_meta_setting( get_the_id(), 'learndash_course_template' ); if ( $template ) {