Skip to content

Instantly share code, notes, and snippets.

View woogist's full-sized avatar

WooCommerce.com Documentation woogist

View GitHub Profile
@woogist
woogist / functions.php
Created March 14, 2014 09:42
change logo on shop page in canvas
function woo_logo () {
$settings = woo_get_dynamic_values( array( 'logo' => '' ) );
// Setup the tag to be used for the header area (`h1` on the front page and `span` on all others).
$heading_tag = 'span';
if ( is_home() || is_front_page() ) { $heading_tag = 'h1'; }
// Get our website's name, description and URL. We use them several times below so lets get them once.
$site_title = get_bloginfo( 'name' );
$site_url = home_url( '/' );
@woogist
woogist / theme-js.php
Created March 30, 2014 21:19
remove true from being printed on the appply theme home page
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! is_admin() ) { add_action( 'wp_enqueue_scripts', 'woothemes_add_javascript' ); }
if ( ! function_exists( 'woothemes_add_javascript' ) ) {
function woothemes_add_javascript() {
global $woo_options;
wp_register_script( 'prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto.js', array( 'jquery' ) );
@woogist
woogist / header.php
Created April 1, 2014 01:38
backup header.php file for sealigth theme with twitter rotating
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<title><?php woo_title(); ?></title>
<?php woo_meta(); ?>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_directory'); ?>/css/effects.css" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $GLOBALS['feedurl'] = get_option('woo_feed_url'); if ( !empty($feedurl) ) { echo $feedurl; } else { echo get_bloginfo_rss('rss2_url'); } ?>" />
@woogist
woogist / woocommerce-shipping-local-pickup-plus-add-pickup-text.php
Created May 1, 2014 17:30
WooCommerce Local Pickup Plus: Add freeform explanatory text above the pickup location dropdown
add_action( 'woocommerce_review_order_before_local_pickup_location', 'local_pickup_instructions' );
function local_pickup_instructions() {
?>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do...</p>
<?php
}
@woogist
woogist / content-404.php
Created May 22, 2014 13:29
fix the canvas 404 page notice
<?php
/**
* Error Content Template
*
* This template is the content template for error screens. It is used to display a message
* to the viewer when no appropriate page can be found by WordPress.
*
* @package WooFramework
* @subpackage Template
*/
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Template Name: Primary landing pg 1
*
* This template is a full-width version of the page.php template file. It
* removes the sidebar area.
*
* @package WooFramework
* @subpackage Template
@woogist
woogist / homepage-mini-features.php
Created June 17, 2014 11:43
mini features icon link to post custom settings specified url
<?php
/**
* Homepage Features Panel
*/
/**
* The Variables
*
* Setup default variables, overriding them if the "Theme Options" have been saved.
*/
@woogist
woogist / functions.php
Created June 17, 2014 12:26
add slider to the shop page
//load the slides on the shop page:
add_action( 'woocommerce_before_shop_loop', 'shop_woo_featured_slider_loader' );
function shop_woo_featured_slider_loader () {
if( is_shop() ){
$settings = woo_get_dynamic_values( array( 'featured' => 'true' ) );
get_template_part( 'includes/featured', 'slider' );
}
} // End woo_featured_slider_loader()
@woogist
woogist / index.php
Created June 25, 2014 16:12
Statua theme - fixes the warning division by zero error
<?php get_header(); ?>
<?php global $woo_options; ?>
<?php if ( !isset($woo_options[ 'woo_homepage_layout_choice' ]) ) { get_template_part( 'layouts/home-layout-error' );
} elseif ( is_home() && ( $woo_options[ 'woo_homepage_layout_choice' ] == '0' ) ) { get_template_part( 'layouts/home-layout-error' );
} else { ?>
<?php if ( $woo_options[ 'woo_homepage_layout_choice' ] == 'A' && is_home() && !is_paged() ) get_template_part( 'layouts/home-layout-a' ); ?>
<?php if ( $woo_options[ 'woo_homepage_layout_choice' ] == 'B' && is_home() && !is_paged() ) get_template_part( 'layouts/home-layout-b' ); ?>
<?php if ( $woo_options[ 'woo_homepage_layout_choice' ] == 'C' && is_home() && !is_paged() ) get_template_part( 'layouts/home-layout-c' ); ?>
<?php } ?>
@woogist
woogist / theme-functions.php
Created July 1, 2014 08:28
change the blog section message to the same as the home page blog area message
<?php
/*-----------------------------------------------------------------------------------
TABLE OF CONTENTS
- Exclude categories from displaying on the "Blog" page template.
- Exclude categories from displaying on the homepage.
- Register WP Menus
- Breadcrumb display