Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@thomasplevy
Created September 12, 2016 21:52
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/61dad9e5521aee293359f60f6052ae96 to your computer and use it in GitHub Desktop.
Save thomasplevy/61dad9e5521aee293359f60f6052ae96 to your computer and use it in GitHub Desktop.
<?php
/**
* Custom twenty sixteen excerpt to pevent "restricted content" from being displayed
* on courses
* @see https://github.com/gocodebox/lifterlms/issues/184
* @param string $class classes to add
* @return void
*/
function twentysixteen_excerpt( $class = 'entry-summary' ) {
if ( function_exists( 'is_course' ) && is_course() ) {
return;
}
$class = esc_attr( $class );
if ( has_excerpt() || is_search() ) : ?>
<div class="<?php echo $class; ?>">
<?php the_excerpt(); ?>
</div><!-- .<?php echo $class; ?> -->
<?php endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment