Skip to content

Instantly share code, notes, and snippets.

@geoffspink
geoffspink / rename_woocommerce_admin_menu.php
Created November 10, 2014 07:07
Rename the Admin Menu name for WooCommerce to the name of the website store.
<?php
add_action( 'admin_menu', 'rename_woocoomerce_admin_menu', 999 );
function rename_woocoomerce_admin_menu()
{
global $menu;
// Pinpoint menu item
$woo = recursive_array_search_php( 'WooCommerce', $menu );
@geoffspink
geoffspink / woocommerce-support.php
Last active August 29, 2015 14:08
Excerpt from functions.php, provides support for WooCommerce archive-product.php. This script detects the orientation of the product thumbnail from the product archive, and wraps the image in a div to allow a CSS style to be applied so as to display the image in uploaded orientation rather then the default square thumbnail.
<?php
/**
* This snippet removes the action that inserts thumbnails to products in the loop
* and re-adds the function customized with our wrapper in it.
* It applies to all archives with products.
* Original gist here: https://gist.github.com/krogsgard/3015581
*
*/
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
@geoffspink
geoffspink / Ubuntu 12.04 LTS setup
Last active August 29, 2015 13:57
Set up Ubuntu 12.04 LTS with utilities and LAMP
# Basic setup and LAMP install for Ubuntu 12.04 LTS VM + Server
sudo apt-get update
sudo apt-get install -y vim
sudo apt-get install -y curl
sudo apt-get install -y build-essential
# The steps below are for php 5.5 instead of 5.3
sudo apt-get install -y python-software-properties
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update