开发者

Wordpress modify returned search results

开发者 https://www.devze.com 2023-04-02 19:38 出处:网络
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.

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

精彩评论

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