Skip to content

Commit

Permalink
Fix: don't include learndash's content on the page when custom templa…
Browse files Browse the repository at this point in the history
…te is being rendered

Hide the button and course details using CSS
  • Loading branch information
Nikschavan committed Mar 6, 2018
1 parent 6ea73a8 commit 33f50fc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions classes/class-ctlearndash.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
';
Expand Down Expand Up @@ -278,7 +284,7 @@ public function override_template_include() {
*/
public function render( $content ) {

$content .= '<div class="custom-template-learndash-content">';
$content = '<div class="custom-template-learndash-content">';
$template = get_course_meta_setting( get_the_id(), 'learndash_course_template' );

if ( $template ) {
Expand Down

0 comments on commit 33f50fc

Please sign in to comment.