Skip to content

Instantly share code, notes, and snippets.

@dwainm
Last active November 23, 2017 06:52
Show Gist options
  • Save dwainm/d24a82ddfec000afcd0112c87c55d71f to your computer and use it in GitHub Desktop.
Save dwainm/d24a82ddfec000afcd0112c87c55d71f to your computer and use it in GitHub Desktop.
Fame Themes OnePress Sensei Wrappers ( integration ) https://www.famethemes.com/themes/onepress
<?php // << make sure to remove this `<?php` if you're copying this into your functions.php
//
// Your code goes below
//
/** Sensei Integration **/
add_action( 'after_setup_theme', 'declare_sensei_support' );
function declare_sensei_support() {
add_theme_support( 'sensei' );
}
remove_action( 'sensei_before_main_content', array( Sensei()->frontend, 'sensei_output_content_wrapper' ), 10 );
remove_action( 'sensei_after_main_content', array( Sensei()->frontend, 'sensei_output_content_wrapper_end' ), 10 );
add_action('sensei_before_main_content', 'my_theme_sensei_wrapper_start', 10);
add_action('sensei_after_main_content', 'my_theme_sensei_wrapper_end', 10);
function my_theme_sensei_wrapper_start() {
?>
<div id="content" class="site-content">
<div class="page-header">
<div class="container">
<?php
if( is_singular( 'quiz' ) ) {
echo '<h1 class="entry-title">' . get_the_title() . ' ' . __( 'Quiz', 'woothemes-sensei' ) . '</h1>';
} else {
the_title( '<h1 class="entry-title">', '</h1>' );
}
?>
</div>
</div>
<?php echo onepress_breadcrumb(); ?>
<div id="content-inside" class="container right-sidebar">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
}
function my_theme_sensei_wrapper_end() {
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php if ( $layout != 'no-sidebar' ) { ?>
<?php get_sidebar(); ?>
<?php } ?>
</div><!--#content-inside -->
</div><!-- #content -->
<?php
}
/** /Sensei Integration **/
article.course header h1,
article.lesson header h1,
article.quiz header h1
{
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment