$_SERVER[‘DOCUMENT_ROOT’], You’ve Done Me Wrong

$_SERVER[‘DOCUMENT_ROOT’] is good for getting the full path to your websites root folder, but depending on the DocumentRoot directive in httpd.conf you may or may not have a forward slash at the end of the returned url.  This always annoys me when developing locally and everything is working.  Then you upload and test on the production system, …

$_SERVER[‘DOCUMENT_ROOT’], You’ve Done Me Wrong Read More »

CSS Ready Classes for Gravity Forms

These are classes defined in the Gravity Forms style-sheets that allow for more complex layouts. These classes can be assigned under the advanced tab, for the field labeled “CSS Class Names”. For two column layouts use: gf_left_half gf_right_half For three column layouts use: gf_left_third gf_middle_third gf_right_third List classes (turn multiple choice/checkbox into multiple columns) gf_list_2col …

CSS Ready Classes for Gravity Forms Read More »

Disable WordPress Editor for Security

Add a little security to wordpress by disabling the editor in the admin area.  If an admin user is successfully hacked, any page can be changed with this editor, so disable the option in the wp-config.php file.

Output Encoded PHP String for Use in a Javascript Variable

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. …

Output Encoded PHP String for Use in a Javascript Variable Read More »

Permalink to Blog Page

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

Target Specific Shopp Template Pages

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 …

Target Specific Shopp Template Pages Read More »

Scroll to Top