Skip to content

Commit

Permalink
Merge pull request #2 from brainstormforce/fix-learndash-content-hide
Browse files Browse the repository at this point in the history
Correctly hide the content added by learndash when custom template is used.
  • Loading branch information
Nikschavan authored Mar 6, 2018
2 parents 043c63f + 33f50fc commit ec8315c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions classes/class-ctlearndash.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,19 @@ 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 .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 @@ -280,10 +284,15 @@ public function override_template_include() {
*/
public function render( $content ) {

$content = '<div class="custom-template-learndash-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 .= '</div>';

return $content;
}

Expand Down

0 comments on commit ec8315c

Please sign in to comment.