Skip to content

Instantly share code, notes, and snippets.

@m-pokrovskii
Last active December 13, 2015 19:28
Show Gist options
  • Save m-pokrovskii/4962913 to your computer and use it in GitHub Desktop.
Save m-pokrovskii/4962913 to your computer and use it in GitHub Desktop.
How to get text before <!-- more -->
<?php
if( strpos($post->post_content, '<!--more-->') ) {
preg_match ('/(.*)<!--more-->/s', $post->post_content, $match);
echo $match[0]
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment