Archive for January, 2012

Remove Links menu item in WordPress

Problem: I’m customising a WP install for a client, adding some Custom Post Types and wotnot, and they aren’t going to have any need for the Links thing. Fix: Adding this to your theme’s (or child-theme’s) functions.php removes the page and the menu link: function nuke_menu_items(){ remove_menu_page( ‘link-manager.php’); //remove_menu_page( ‘upload.php’); //remove other items etc etc [...]

Cheap & simple fix for a leaking fermenting bin (homebrew)

Problem: I’ve just put a brew on using some cheap equipment from an online retailer. The lid of the fermenting bin is loose fitting so the beer is gassing around the lid or through the airlock grommet and not through the airlock / bubbler itself. This is not really a problem while the Krausen is [...]

Searching between dates in GMail

Problem: I’m doing my tax return And need to frequently look for emails sent andĀ receivedĀ in the 2010/11 tax year. Fix: Gmail is really powerful when the text search box is used. There are various advanced search operators but the ones that help here are ‘before:’ and ‘after:’. When twinned with ‘from:’ or ‘to:’ it returns [...]

Adding category depth tag to Shopp 1.1.*

Problem: I needed to display sub categories of a category in category.php but only one level deep. Using: <?php if(shopp(’category’,'hascategories’)): ?> <?php while(shopp(’category’,'subcategories’)): ?> //display stuff <?php endwhile; ?> <?php endif; ?> …displays all subcast AND their subcats. Fix: I decided to add a new tag, called shopp(‘subcategory’, ‘depth’) that would return the category depth. [...]

Getting subcategory totals [shopp('subcategory','total')] to work in Shopp Plugin 1.1.*

Problem: Pulling the total number of products from a subcat in Shopp doesn’t seem to work out the box. For example, this code WON’T return the total even though the correct tag shopp(‘subcategory’,’total’) is used: <?php while(shopp(’category’,'subcategories’)): ?> <?php shopp(’subcategory’,'name’); ?> (<?php shopp(’subcategory’,'total’); ?>) <?php endwhile; ?> Fix: For the products to be countable, the [...]