Snippets »

Force specific pages to be secure, ssl, https

Force specific pages to be secure, ssl, https

ThinkWP August 19, 2014

You can easily force specific pages to be secure in wordpress using the following simple little snippet.

Read More »
Add class to first post in the loop

Add class to first post in the loop

ThinkWP August 19, 2014

If you wanted to add emphasis to the first post in your blog adding this snippet to the functions.php of your wordpress theme will add the class of “first” to your first post.

Read More »
Add Custom User Profile Fields

Add Custom User Profile Fields

ThinkWP August 19, 2014

Heres a little trick on how to add custom user profile fields. Instructions Add this code to your functions.php file and edit or add lines as you see fit

Read More »
Remove Author Prefix From Slug

Remove Author Prefix From Slug

ThinkWP August 19, 2014

Heres a little trick on how to remove the author prefix from the author slug. To clarify, this snippet will help you turn: ‘ http://domain.com/author/peter/ ‘ into: ‘ http://domain.com/peter/ &#

Read More »
Show most popular posts without a plugin

Show most popular posts without a plugin

ThinkWP August 19, 2014

Heres a little trick on how to show a list of the most popular post by post read count – without using a plugin.

Read More »
Author List With Avatar Thumbnail

Author List With Avatar Thumbnail

ThinkWP August 19, 2014

Heres a little tip on how display an author list with Avatars and username. Instructions Add this code anywhere in your 'templates' file.

Read More »
Multiple excerpt lengths

Multiple excerpt lengths

ThinkWP August 19, 2014

This snippet will allow you to set custom excerpt lengths in your excerpt tag in your template. Instructions Add this code to your functions.php file. function excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(),

Read More »
How to Display Recent Posts From A Specific Category In WordPress

How to Display Recent Posts From A Specific Category In WordPress

ThinkWP August 19, 2014

Heres a little snippet that will display recent posts from a specific category.

Read More »
Modify WordPress img src for the “get_the_post_thumbnail”

Modify WordPress img src for the “get_the_post_thumbnail”

ThinkWP August 19, 2014

Expose the WordPress “ img src ” part from the get_the_post_thumbnail, to modify the “img src” syntax.

Read More »
Kill WordPress execution

Kill WordPress execution

ThinkWP October 16, 2011

wp_die kills the WordPress execution and display HTML message with error message. A call to this function complements the die() PHP function. The difference is that HTML will be displayed to the user. It

Read More »