Skip to content

Commit

Permalink
Improve the inline css to hide the content added by learndash
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikschavan committed Mar 6, 2018
1 parent 043c63f commit 6ea73a8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions classes/class-ctlearndash.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
';
Expand Down Expand Up @@ -280,10 +278,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 6ea73a8

Please sign in to comment.