Skip to content

Instantly share code, notes, and snippets.

@Welland
Welland / Unset WooCommerce Reviews Tab
Last active September 1, 2015 15:33
Unset WooCommerce Reviews Tab
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['reviews'] );
return $tabs;
}
@kloon
kloon / functions.php
Last active October 16, 2022 16:46
WooCommerce 2.1 variation price, revert to 2.0 format
/**
* Use WC 2.0 variable price format, now include sale price strikeout
*
* @param string $price
* @param object $product
* @return string
*/
function wc_wc20_variation_price_format( $price, $product ) {
// Main Price
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
@adampmoss
adampmoss / magento-logo-schema.php
Created January 10, 2014 16:07
Magento Logo with Schema
<div itemscope itemtype="http://schema.org/Organization">
<a itemprop="url" href="<?php echo $this->getUrl('') ?>">
<img itemprop="logo" src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
</a>
</div>
@robertkent
robertkent / gist:7039138
Created October 18, 2013 09:41
Couple of Wordpress functions to change opengraph data used within the Yoast extension.
add_filter('wpseo_locale', 'override_og_locale');
function override_og_locale($locale)
{
return "en_GB"; // thanks to stack overflow for this
}
add_filter('wpseo_opengraph_type', 'homepage_opengraph_type');
function homepage_opengraph_type($type)
{
$page = get_the_ID();
@adampmoss
adampmoss / local.xml
Last active April 3, 2018 22:41
Magento local.xml Boilerplate
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- ############# GLOBAL LAYOUT UPDATES ############# -->
<default>
<!-- Remove unwanted blocks entirely
<remove name="right.poll"/>
<remove name="right.permanent.callout"/>
@robertkent
robertkent / Creare_Twitter_Example.php
Created July 17, 2013 08:40
The example.php from our Creare_Twitter class implementation
<?php
require_once('Creare_Twitter.php');
$twitter = new Creare_Twitter();
##########################################################
# You can either edit the following per implementation - #
# or simply edit them in the class and remove all of #
# these property overrides #
@corsonr
corsonr / Add CPTs to search
Created October 13, 2012 09:54
Add CPTs to search
@gyrus
gyrus / gist:3155982
Created July 21, 2012 14:40
Rename WordPress "Posts" to "News"
<?php
/**
* Rename "Posts" to "News"
*
* @link http://new2wp.com/snippet/change-wordpress-posts-post-type-news/
*/
add_action( 'admin_menu', 'pilau_change_post_menu_label' );
add_action( 'init', 'pilau_change_post_object_label' );
function pilau_change_post_menu_label() {
@frontweb
frontweb / uk_post_code.html
Created March 19, 2011 19:44
Plot a UK post code on Google Maps
<html>
<head>
<title>UK Post Code</title>
<style type="text/css">
#map_canvas { width:300px; height:200px; }
</style>
<script type="text/javascript">
function initialize() {
@jnrbsn
jnrbsn / better-gist-styles.css
Created September 14, 2010 01:24
Better styles for embedding GitHub Gists
/* Better styles for embedding GitHub Gists */
.gist{font-size:13px;line-height:18px;margin-bottom:20px;width:100%}
.gist pre{font-family:Menlo,Monaco,'Bitstream Vera Sans Mono','Courier New',monospace !important}
.gist-meta{font-family:Helvetica,Arial,sans-serif;font-size:13px !important}
.gist-meta a{color:#26a !important;text-decoration:none}
.gist-meta a:hover{color:#0e4071 !important}