From 502391a5a96547dcc4092fcb4dee78c665004bdf Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Wed, 6 Nov 2024 16:07:50 -0300 Subject: [PATCH 1/2] Don't load learning mode styles on course pages --- includes/3rd-party/themes/astra.php | 2 +- includes/3rd-party/themes/course.php | 2 +- includes/3rd-party/themes/divi.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/3rd-party/themes/astra.php b/includes/3rd-party/themes/astra.php index fea5a4d201..311c2391e2 100644 --- a/includes/3rd-party/themes/astra.php +++ b/includes/3rd-party/themes/astra.php @@ -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; } diff --git a/includes/3rd-party/themes/course.php b/includes/3rd-party/themes/course.php index 1b7e1d257d..70c3ecf35b 100644 --- a/includes/3rd-party/themes/course.php +++ b/includes/3rd-party/themes/course.php @@ -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; } diff --git a/includes/3rd-party/themes/divi.php b/includes/3rd-party/themes/divi.php index 357c4542d0..e63dc1fd43 100644 --- a/includes/3rd-party/themes/divi.php +++ b/includes/3rd-party/themes/divi.php @@ -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; } From 16398c9b484068f69a59131aafcbdccdd9465715 Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Wed, 6 Nov 2024 16:52:28 -0300 Subject: [PATCH 2/2] Add changelog --- changelog/fix-course-horizontal-scroll-with-course-theme | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/fix-course-horizontal-scroll-with-course-theme diff --git a/changelog/fix-course-horizontal-scroll-with-course-theme b/changelog/fix-course-horizontal-scroll-with-course-theme new file mode 100644 index 0000000000..2fa06e932f --- /dev/null +++ b/changelog/fix-course-horizontal-scroll-with-course-theme @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix horizontal scroll on Course page when using Course theme