wordpress snippets last updated   : April 22, 2014
we now have 631 snippets

Dynamically create and attach sidebars to pages or posts

wordpress snippet

This is a bit large for the snippets I normally post however very useful. This snippet will let you easily create new sidebars by simply adding the name to an array. You will also be able to define the dynamically created sidebar a page loads by selecting from the custom sidebar selection metabox.

read more

Display attachment thumbnail with image metadata

wordpress snippet

Adding this snippet within the loop of your index.php template file will display a list of all post attachments with the following metadata (Credit, Camera, Focal Length, Aperture, ISO, Shutter Speed, Time Stamp, Copyright).

read more

Enable google docs shortcode for .pdf documents

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will setup [pdf] shortcode to link PDF documents to Google docs online viewer.

read more

Change the author slug, URL base

wordpress snippet

Adding this to the functions.php of your wordpress theme will change the default mysite.com/author/name to mysite.com/profile/name, however you can change this to user or anything that you would like.

read more

Post is older than

wordpress snippet

Adding this first block of code to your functions.php will allow you to check the age of a post to see if it is older than a set number of days. Great if you want to display some some information related to the post after set number of days or even stop displaying the post altogether.

read more

Exclude pages from admin edit pages list

wordpress snippet

This is a great little snippet that will exclude pages based on the the ID from the admin pages list. Just add this snippet to the functions.php of your wordpress theme and update the array with the page ID’s you wish to hide. Please note this does not stop a post from being editable this snippet only hides the page from view.

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