开发者

Wordpress modify returned search results

When I search on my wordpress site I want to filter the search results, namely, I want to remove the first line of each search result.

However wordpress returns the text with all newlines removed, just a chunk of text, so I can not decipher where the new lines are removed.

I tried overriding the

function wp_trim_excerpt($text)
开发者_JS百科

Function, but the $text passed there already has new lines removed. Can someone point me in the right direction of where/when this happens so I can modify the function?


It's removed because the loop.php will use the_excerpt() for searches and archives by default. Change it to the_content() or create / use your own custom function to return the search results in the format you want it in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜