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

Display specific content if post has_tag or specific tag

wordpress snippet

Adding this snippet within the loop of your wordpress template will let you display specific content if a post has tags or not. Also note that has_tag(‘tag_name’) suports, tag name, term_id or slug and an array of tag names, term ids and slugs. Also a big thanks to Jeremy for submitting the following.

read more

Display wp_list_pages with dynamicly created exclude list

wordpress snippet

Adding the first snippet to the functions.php of your wordpress theme will use wp_list_pages but filter out any pages that contain no content creating an excluded_pages array. Then add the second snippet into your wordpress theme in the location you wish to display the pages.

read more

Redirect user to new post when published using wp_redirect

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will redirect a user to the new post or page after it is published.

read more

Redirect commenter to thank you post or page

wordpress snippet

Why not thank your visitors! Let them know they are important by redirecting them to a thank you page where you can display a great big thank you for commenting on my wordpress site message. Adding this snippet to the functions.php of your wordpress theme will redirect a commenter to any post or page you specify. To update the snippet to a page change wp_redirect('/page/'); replace /page/ with whatever page you would like eg: wp_redirect('/thank-you/');.

read more

Display most recently updated posts and pages

wordpress snippet

Adding this snippet to your wordpress theme will display a list of the most recently updated posts and pages.

read more

Custom column with currently active page template

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a column to your admin pages showing which wordpress page template currently in use.

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