Skip to content

Instantly share code, notes, and snippets.

@generatepress
Last active March 10, 2018 07:53
Show Gist options
  • Save generatepress/71df96fd4ecaad5ffafa46e347cee294 to your computer and use it in GitHub Desktop.
Save generatepress/71df96fd4ecaad5ffafa46e347cee294 to your computer and use it in GitHub Desktop.
Integrate LifterLMS layouts into GP
function tu_lifterlms_start() { ?>
<div id="primary" <?php generate_content_class();?>>
<main id="main" <?php generate_main_class(); ?>>
<?php do_action('generate_before_main_content'); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'CreativeWork' ); ?>>
<div class="inside-article">
<?php do_action( 'generate_before_content'); ?>
<div class="entry-content" itemprop="text">
<?php
}
add_action( 'lifterlms_before_main_content', 'tu_lifterlms_start' );
function tu_lifterlms_end() {
?>
</div><!-- .entry-content -->
<?php do_action( 'generate_after_content'); ?>
</div><!-- .inside-article -->
</article><!-- #post-## -->
<?php do_action('generate_after_main_content'); ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
}
add_action( 'lifterlms_after_main_content', 'tu_lifterlms_end' );
function tu_llms_theme_support() {
add_theme_support( 'lifterlms-sidebars' );
}
add_action( 'after_setup_theme', 'tu_llms_theme_support' );
function tu_llms_sidebar_function( $id ) {
$my_sidebar_id = 'sidebar-1';
return $my_sidebar_id;
}
add_filter( 'llms_get_theme_default_sidebar', 'tu_llms_sidebar_function' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment