Skip to content

Instantly share code, notes, and snippets.

@thomasplevy
Created July 27, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasplevy/8bfedef89eaf3c4292bd7d685d80f22e to your computer and use it in GitHub Desktop.
Save thomasplevy/8bfedef89eaf3c4292bd7d685d80f22e to your computer and use it in GitHub Desktop.
<?php
$lesson = new LLMS_Lesson( get_the_ID() );
// previous
$prev_id = $lesson->get_previous_lesson();
if ( $prev_id ) {
$prev_section = new LLMS_Section( $prev_id );
echo get_the_title( $prev_section->id );
}
$next_id = $lesson->get_next_lesson();
if ( $next_id ) {
$next_section = new LLMS_Section( $next_id );
echo get_the_title( $next_section->id );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment