[ Tag Archive ]
Quick & Easy Excerpt Mods Coming in WordPress 2.9
I just stumbled across these two little pieces of code and thought that they might be useful to some people out there who want to mess around with the default settings for the_excerpt() function in WordPress. The first one gives you the power to change the number of words displayed by the function the_excerpt(), and yes, you can have more than 55 words. The second piece of code allows you to change the trailing [...] that appears at the end of your excerpt.
Retrieve and Display Images from a WordPress Post
I have already mentioned a few ways to do this but I have discovered a few problems with my old code. I have improved this one quite a bit so I felt that I should just delete my old suggestions and offer you the best technique I have discovered.
Excerpt or Content Word Limit in WordPress: Redux
This is just a revamp of a function I wrote a while back to add the ability to limit the number of words displayed when you call the excerpt or content. As it stands, the max number of words for the excerpt is 55. There is a new function with WP 2.9 to increase this number. Check out Quick & Easy Excerpt Mods Coming in WordPress 2.9 for more on that subject.
Removing Images from a WordPress Post: Redux
I just discovered some issues with this code so I fiddled around and discovered a better way to code it.
Here is a better version to use.
<?php
$content = get_the_content();
$postOutput = preg_replace('/<img[^>]+./','', $content);
echo $postOutput;
?>





