tainterr
tainterr

Reputation: 73

wordpress to use <!-break--> in addition to <!--more-->

I'm importing posts from a Drupal feed that uses <!--break--> instead of <!--more-->. I'm thinking that I could scan the content and replace all instances of <!--break--> with <!--more-> from my functions php, but it seems like there would be an easier way to make the function that is already looking for <!--more--> validate and trigger off of <!--break--> as well. Any ideas or other innovative ways that I can trigger the page break from <!--break--> in Wordpress?

Upvotes: 0

Views: 67

Answers (1)

Adam Rivers
Adam Rivers

Reputation: 1075

You can just modify the existing function. open up the wp-includes/post.php file. Find the get_extended function and replace

if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) ) {

with

if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) || preg_match('/<!--break(.*?)?-->/', $post, $matches) ) {

Upvotes: 1

Related Questions