Skip to content

Instantly share code, notes, and snippets.

@nacin
Last active December 23, 2015 07:39
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nacin/ab97d4b0e57b169d26d5 to your computer and use it in GitHub Desktop.
<?php
/**
* Here's a template tag that always forces <!--more--> to be obeyed.
* Unfortunately this is suck a hack, I'm declining to publish it myself.
* This could make a good bug report for core, though. I would suggest a
* title of "Can't retrieve calculated excerpt bound by <!--more--> on single page view".
* I'd be happy to see what we can do to fix this.
*/
function always_the_excerpt() {
global $more;
$old_more = isset( $more ) ? $more : null;
$more = 0;
the_excerpt();
$more = $old_more;
}
@chriscoyier
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment