wordpress snippets last updated   : August 18, 2014
we now have 638 snippets
category page

Track post and page views by user ID, date and time

wordpress snippet

After an interesting conversation with a fan of wpsnipp, I come up with something to track unique post views for registered users. However this neat little snippet does a little more than that. First add wps_trackViewDates(); within the loop of your single.php template file. Once this has been added, the snippet will track the ID of the user that viewed an individual post along with the date and time it was viewed.

read more

Create page on theme activation

wordpress snippet

If you are creating a new theme either for sale of for a client you may want to have it create a custom page or pages when the theme is activated. Adding this snippet to the functions.php of your theme will do just that.

read more

Stop Disqus from outputting JS on anything but single posts or pages

wordpress snippet

Disqus outputting JS on parts of your wordpress website you don’t want? Adding this snippet to the functions.php of your wordpress theme will only output JS on is_singular posts or pages where comments are available.

read more

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

Add custom field automatically when post or page is publish

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a custom field to a post or page when published. Don’t forget to update the FIELD_NAME and the CUSTOM VALUE.

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