This is my repository of code snippets, url links, and other stuff  that I use to develop website with.  The main purpose of this site is to catalog, and easy search for the stuff that I use on a regular basis.

Show me the Errors

April 7, 2013

Add this snippet of code at the top of the page to display any errors that may be thrown. Be sure to remove this code before pushing out to a production environment. For wordpress specific sites, the following code is useful in the wp-config.php file if you are trouble shooting a live site, and don’t […]

Get a persons age from their birthdate

March 26, 2013

I’ve found this function to be the most accurate for calculating a persons age (knowing their birthdate). Source: http://spyk3lc.blogspot.com/2012/03/php-get-age-comparison-results-of-3.html

Get first image from content

March 26, 2013

The following functions are useful especially when pull an rss feed from a remote site, and you want to display the first image in the post. returnImage() will return the first entire image tag, which can then be passed to scrapeImage to return just the image source.

Add .last class to menus

March 26, 2013

Adding this code to the functions.php file will append the class “last” to the last li tag outputed by wp_nav_menu. Very useful for when you need to style the last link in a drop down menu different from the others, or to remove that a separate after the last link in a horizontal menu.

Scroll to Top