Skip to content

Commit

Permalink
Merge pull request #7705 from Automattic/fix/course-horizontal-scroll…
Browse files Browse the repository at this point in the history
…-with-course-theme

Fix horizontal scroll on Course page when using Course theme
  • Loading branch information
renatho authored Nov 7, 2024
2 parents a7076db + 16398c9 commit 6f39f3b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-course-horizontal-scroll-with-course-theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix horizontal scroll on Course page when using Course theme
2 changes: 1 addition & 1 deletion includes/3rd-party/themes/astra.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function sensei_load_learning_mode_styles_for_astra_theme() {
$course_id = Sensei_Utils::get_current_course();
$is_target_theme = 'astra' === strtolower( wp_get_theme()->get_template() );

if ( empty( $course_id ) || ! $is_target_theme ) {
if ( empty( $course_id ) || ! $is_target_theme || 'course' === get_post_type() ) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion includes/3rd-party/themes/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function sensei_load_learning_mode_style_for_course_theme() {
$course_id = Sensei_Utils::get_current_course();
$is_course_theme = 'course' === wp_get_theme()->get_template();

if ( empty( $course_id ) || ! $is_course_theme ) {
if ( empty( $course_id ) || ! $is_course_theme || 'course' === get_post_type() ) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion includes/3rd-party/themes/divi.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function sensei_load_learning_mode_style_for_divi_theme() {
$course_id = Sensei_Utils::get_current_course();
$is_target_theme = 'divi' === strtolower( wp_get_theme()->get_template() );

if ( empty( $course_id ) || ! $is_target_theme ) {
if ( empty( $course_id ) || ! $is_target_theme || 'course' === get_post_type() ) {
return false;
}

Expand Down

0 comments on commit 6f39f3b

Please sign in to comment.