Force SSL for WordPress Admin

If you have an SSL setup for the websites domain, it should be enforced for the wordpress admin login, and all admin pages (typically because the site has the SSL because of ecommerce).  Add this contant definition to wp-config.php to force SSL on login and admin pages.

Shopp Plugin – Disable SSL for Development

When developing a shopping cart using the shopp plugin, if you are testing a payment gateway that requires an SSL certificate, you can have difficulties fully testing the site.  Add this constant to wp-config.php to disable SSL redirects on the checkout page: Just remember to remove it when the site is launched for production use.

STOP Annoying Links on Image Inserts

I found this little snippet on Norcross blog.  It will save me a lot of agreviation in the future with the anchor tags to the attachment page or media file.

Reset Shopp Cart for Development

During development and testing, you may need to reset the items in the cart, promo codes, shipping zip codes.  To do this use the following variable in the url for the shop page: yourwebsite.com/shop/?shopping=reset

Show me the Errors

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 …

Show me the Errors Read More »

Get a persons age from their birthdate

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

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

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