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.
I recently had to move a wordpress site to a totally new domain name. The Backup buddy plugin makes this a breeze, but google (and the other search engines) are still pointing to the old domain name. To redirect users to the corresponding page on the new domain, and to get google to update the […]
I recently had a project where I needed to display all the rows from a mySQL database where the a date field occurred in the current week (From Sunday to Saturday). To keep from building out a complete query in php, I went with a little less complex query all in the SQL query. Using […]
CodeIgniter uses it’s own sessions variables, so you won’t be working with native PHP sessions and functions. Below are how to set and get session variables, as well as display all the session variables for debugging. Set a session variable ‘user_id’ with a value of 41: Get a session variable ‘user_id’ and display it: […]
The current version of shopp when WordPress 3.7 was release is version 1.2.9. In some cases, the storefront catalog page does not display properly in WordPress 3.7. To fix this problem, the following snippet needs to be added to the functions.php file: Fix was provided by Barry on the Shopp support forums.
The print order page in the admin of shopp on the order page is fairly atrocious. Which is odd, since the email receipt looks nice, and uses the exact same html mockup. To fix this, add a new file in the shopp templates folder named “receipt-admin.php” and paste in the following code to make the […]
$_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, […]
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 […]
I recently needed to add pagination to a CodeIgniter project, so I used the pagination helper to accomplish that. The only problem was styling the output using twitter bootstrap. The default pagination output was not output in an unordered list, and it was missing all the class assignments for styling. So, a quick Google search […]
Some wordpress site are only used as a content management system and don’t require comments and trackbacks. For sites that already have content, these sql queries can be used to disable the comment and trackbacks with out having to manually edit each page/post. Note: be sure to adjust the wordpress prefix to match the one […]
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.