Eu resolvi isso criando duas funções para dividir the_content()
em uma função antes e depois:
class MyClass
{
/**
* Echo the content before the <!--more--> tag
*/
public static function getContentBeforeMore()
{
global $more;
$more = false;
the_content(false);
$more = true;
}
/**
* Echo the content after the <!--more--> tag
*/
public static function getContentAfterMore($removeMoreTag = true)
{
$content = get_the_content(null, true);
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
// Remove the empty paragraph with the <span id="more-.."></span>-tag:
if($removeMoreTag)
{
$content = preg_replace('/<p><span id="more-\d+"><\/span><\/p>/m', '', $content);
}
echo $content;
}
}
Em um modelo, ele pode ser usado assim:
<p class="intro"><?php MyClass::getContentBeforeMore(); ?></p>
... some other styling, like date or something ...
<?php MyClass::getContentAfterMore(); ?>