Skip to content

Instantly share code, notes, and snippets.

@akther80
Created September 4, 2023 11:20
Show Gist options
  • Save akther80/53334480a023c56da06fa6d5cb0149ed to your computer and use it in GitHub Desktop.
Save akther80/53334480a023c56da06fa6d5cb0149ed to your computer and use it in GitHub Desktop.
Geeks - display footer in single lesson page
function page_footer( $disabled ) {
global $post;
$student_register_page_id = (int) tutor_utils()->get_option( 'student_register_page' );
$has_content_access = tutils()->has_enrolled_content_access('lesson');
$instructor_register_page_id = (int) tutor_utils()->get_option( 'instructor_register_page' );
$post_id = isset( $post->ID ) ? $post->ID : false;
$parents = get_post_ancestors( $post_id );
$course_id = ($parents) && ! empty( $parents ) ? $parents[count($parents)-1]: $post_id;
$is_course_public = get_post_meta( $course_id, '_tutor_is_public_course', true );
$_is_preview = get_post_meta( $post_id, '_is_preview', true );
if ( is_page( $student_register_page_id ) || is_page( $instructor_register_page_id ) ) {
$disabled = true;
}
if ( ( 'yes' === $is_course_public || $_is_preview ) && !is_archive() && ! is_single_course() ) {
$disabled = true;
}
return $disabled;
}
.single-lesson .footer-v1 ,
single-quiz .footer-v1 ,
single-assignment .footer-v1 {
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
padding: 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment