Skip to content

Instantly share code, notes, and snippets.

@dwainm
Last active November 23, 2017 06:52
Show Gist options
  • Select an option

  • Save dwainm/d24a82ddfec000afcd0112c87c55d71f to your computer and use it in GitHub Desktop.

Select an option

Save dwainm/d24a82ddfec000afcd0112c87c55d71f to your computer and use it in GitHub Desktop.

Revisions

  1. dwainm revised this gist Nov 23, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <?php // << make sure to remove this `<?php` if you're copying this into your functions.php
    //
    // Your code goes below
    //
  2. dwainm created this gist Nov 23, 2017.
    50 changes: 50 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    //
    // 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 **/
    6 changes: 6 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    article.course header h1,
    article.lesson header h1,
    article.quiz header h1
    {
    display: none;
    }