lundi 5 octobre 2015

Customise Excerpt start and end

I am attempting to customise a search result page to display a title and excerpt that contains the search query.

I am using the "Search everything" plugin for this, and I find that sometimes on a more obscure search query, the excerpt displayed in with get_the_excerpt(); does not contain the search query, as it appears further into the post.

My question is: Can I customise the start index of my excerpt to ensure the search result is within the excerpt, for example:

"... here the except will lead in so find our search query and then lead out again..."

I am working on a site that was built my a colleague who no longer works for the company, so I can't ask him questions, and I would also like to avoid messing around in functions.php and any core functionality, as I don't want to break anything in another section of the site. (as well as my wordpress knowledge is almost non-existent) so I would prefer some kind of page-local based solution.

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire