I wrote a super small post over on the iWeb Control blog to share a WordPress snippet originally written by Pippin Williamson.
It’s a neat function iweb_get_excerpt_by_id()
which returns an excerpt of a posts content. It has a number of parameters which give it a little more power over the default WordPress excerpt function. It’s possible to specify the excerpt length and also which HTML tags are allowed, so you could choose to include some formatting.
Another useful WordPress snippet from Pippin. Pass
iweb_get_excerpt_by_id()
a post ID or a post object to retrieve an excerpt. The function’s second parameter allows you to specify the length of the excerpt in number of words.
Recent Comments