Web & Software Developer

Archive for “Code Graveyard”

The Code Graveyard is where I lay to rest snippets of code that I don’t use anymore. Some have lost their usefulness due to the evolving nature of the web, while others have been replaced with better code.

GeoNames Timezone Search Gives Wrong Latitude for Hamlet, Indiana

The Timezone web service from GeoNames has a little discrepancy that causes big problems for my app. GeoNames Gives Wrong Latitude Degrees for Hamlet, Indiana. See: Hamlet, Indiana latitude degrees according to GeoNames search = 41.5475442 Hamlet, Indiana latitude degrees according to Wikipedia = 41.381667 GeoNames’s incorrect latitude degrees throws my whole app off. I […]

Send Localized PHP variables to jQuery

This was my way of localizing jQuery strings: 1. Set a variable for the localized string in PHP 2. Set that as a jQuery var, and send/hack it up to the head inside my wp_enqueue_scripts function right above the line to enqueue the .js script that needs to use the variable. My method, as is […]

Add Login Form To Lazyest Gallery If User Not Logged In

PROBLEM: If you make your Lazyest Gallery (Lazyest Gallery Plugin by Macbrink) only visible to logged-in users, the gallery will display a message like this: “Please log in or register to view the gallery.” But it doesn’t add a link to login, or a login form. To make the Lazyest Gallery more user-friendly for my […]

Remove Lazyest Gallery Admin Menu For All But Administrators

PURPOSE: Hide the ‘Lazyest Gallery’ menu item from WordPress admin panel Dashboard for everyone but the administrators. This doesn’t hide the entire ‘Lazyest Gallery’ menu item, but it does remove the “edit Gallery” pages. The result is that your subscribers, contributors, authors, and editors will not be able to edit your gallery, nor delete your […]

Show Product SKU Number in WP e-Commerce

This is for use with WP e-Commerce plugin. Use this code if you want to display the “SKU” item number on the single product page (in wpsc-single_product.php). The SKU number is not the same as the Product ID number. The Product ID number (which is like the post ID) is assigned automatically by WordPress. The […]

Show Product Tags as Links

This is for use with WP e-Commerce plugin. Use this code if you want to show the “Product Tags” as links. It works in the single product page container in wpsc-single_product.php. A Caveat to Using Tag Links In WP e-Commerce One drawback is that, as of WP e-Commerce version 3.8.8, it does not support pagination […]