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.

Output Encoded PHP String for Use in a Javascript Variable

June 6, 2013

The problem with just echoing a php sting for a javascript variable is escaping the sting properly for single and double quotes and line returns.  I found this fix for my problem with an apostrophe in the string that closed out the quote early.  This is a better option that trying to use  addslashes.  Use json_encode instead. […]

Permalink to Blog Page

June 1, 2013

Returns the permalink to the blog page by getting the blog page id from the option settings defined in the Reading settings.  

Gravity Forms Scroll To Anchor Tag

May 29, 2013

I came across this filter for Gravity Forms when looking for an option to append classes to the confirmation message output when a form is submitted, and found it to be useful when a form is really long, or is placed further down the page.  It will cause the page to jump to the confirmation […]

Target Specific Shopp Template Pages

May 23, 2013

I find that every build I have requires me looking up the functions to target specific  Shopp template pages, so I’m compiling a list for quick reference. is_account_page() returns true when the current page request is for the account page is_cart_page() returns true when the current page request is for the cart page is_catalog_frontpage() returns true if viewing […]

Add Alert Messages to Checkout Form Validation

May 23, 2013

I found this additional class that can be added to the checkout form that will cause an alert window to be displayed when an input does not validate.  It may be useful for forms where the light red background is not obvious to the user why they can’t submit the form to checkout. This can […]

Force SSL for WordPress Admin

May 23, 2013

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

May 23, 2013

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

May 13, 2013

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

May 6, 2013

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

Different CSS Setting for Each Navigation Link

April 26, 2013

This css trick was applied to a website build where I needed background images tabs to overlay one another, so that the next tab’s z-index was lower than the first one causing the background image to be behind the one to the left of it. My first thought was to use :nth-child to assign the […]

Scroll to Top