wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Automatically link twitter usernames in posts

wordpress snippet

Excellent snippet by Paul Underwood that will automatically link twitter usernames in your posts. This snippet will look for text like @wpsnipp and convert it to <a href="http://twitter.com/wpsnipp">@wpsnipp</a> something I’m sure many of you will find useful.

read more

Use wp_trim_words to trim your text in wordpress

wordpress snippet

WordPress 3.3+ has a core function called wp_trim_words() this function will trim text to a specified number of words and return the result. Adding this snippet to your wordpress loop will let you easily trim the number of words displayed within the_content, the_excerpt, the_title or any other value you pass to this core function.

read more

Display random messages of encouragement, posts

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will allow you to display random messages of encouragement to an author when they create a new post. Messages are displayed in the title field and the content field of new posts and don’t forget to update the array of messages to suite your needs.

read more

Replace keywords in the_content and the_excerpt

wordpress snippet

This is an updated version of the post from a few days ago (Link keywords or replace text in all blog posts) overall this is a better solution if you have a large list of keywords. Adding this PHP snippet to the functions.php of your wordpress theme will allow you to replace keywords within the_content and the_excerpt using an associative array.

read more
jqsnipp.com | we just launched jquery snippets website