From 6ea73a8dca6a3927dbe8279eba54d72836c264ad Mon Sep 17 00:00:00 2001 From: Nikhil Date: Tue, 6 Mar 2018 16:43:39 +0530 Subject: [PATCH 1/2] Improve the inline css to hide the content added by learndash --- classes/class-ctlearndash.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/classes/class-ctlearndash.php b/classes/class-ctlearndash.php index cc6584b..2bbed94 100644 --- a/classes/class-ctlearndash.php +++ b/classes/class-ctlearndash.php @@ -229,16 +229,14 @@ public function enqueue_scripts() { // Add VC style if it is activated. $wpb_custom_css = get_post_meta( $template, '_wpb_shortcodes_custom_css', true ); if ( ! empty( $wpb_custom_css ) ) { - wp_add_inline_style( 'astra-theme-css', $wpb_custom_css ); + wp_add_inline_style( 'learndash_style', $wpb_custom_css ); } // Custom CSS to hide elements from LearnDash when a custom template is used. $css = ' - .custom-template-lifterlms .btn-join { - display: none; - } - - .custom-template-lifterlms #learndash_course_materials { + .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 { display: none; } '; @@ -280,10 +278,15 @@ public function override_template_include() { */ public function render( $content ) { + $content .= '
'; $template = get_course_meta_setting( get_the_id(), 'learndash_course_template' ); + if ( $template ) { - $content = $this->get_action_content( $template ); + $content .= $this->get_action_content( $template ); } + + $content .= '
'; + return $content; } From 33f50fc69c833721563fe4be2d9921fb031f167d Mon Sep 17 00:00:00 2001 From: Nikhil Date: Tue, 6 Mar 2018 16:52:15 +0530 Subject: [PATCH 2/2] 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 ) {