Skip to content

Instantly share code, notes, and snippets.

View mclanecreative's full-sized avatar

adam mclane mclanecreative

View GitHub Profile
@mclanecreative
mclanecreative / functions.php
Last active December 22, 2016 17:50
Adding Product Search extension to Storefront Header - This is how you swap out the WooTheme's default Product Search for Storefront for WooTheme's Product Search Extension. Drop the PHP into your child theme's functions.php. Drop the CSS into your child theme's style.css - enjoy
/* Remove Storefront Product Search in Header*/
add_action( 'init', 'jk_remove_storefront_header_search' );
function jk_remove_storefront_header_search() {
remove_action( 'storefront_header', 'storefront_product_search', 40 );
}
/* Add Product Search extension to replace default search product*/
if ( ! function_exists( 'storefront_all_search' ) ) {
function storefront_all_search() {
if ( function_exists( 'woocommerce_product_search' ) ) {
@mclanecreative
mclanecreative / style.css
Created June 8, 2015 22:05
Customizations for my Storefront theme - Cartel v. 4.0
/*
Theme Name: Cartel 4.0
Theme URI: http://theyouthcartel.com/
Description: Version 4 of the best damn youth ministry site in the land
Author: Adam McLane
Author URI: http://theyouthcartel.com
Template: storefront
Version: 2.0.0
*/
@mclanecreative
mclanecreative / Add Sticky Post to WooTheme's Storefront theme homepage
Last active August 29, 2015 14:21
Add Sticky Post to WooTheme's Storefront theme homepage
Note: Make sure you've created a Storefront Child Theme before attempting this. (https://codex.wordpress.org/Child_Themes) See this customization live here: https://theyouthcartel.com
Changelog
*0.1*
- Hell yeah, got it to work
- Adds sticky post to homepage template
- If no sticky post is selected, displays the latest post
@mclanecreative
mclanecreative / my-account.php
Last active March 27, 2023 23:12
Adds Tabs to WooCommerce "My Account" page. Instructions: add my-account.php to your /woocommerce/myaccount/ folder. Next, add the CSS to your child theme's style.css file. 11/25/2015 - Added tab6 for Event Espresso WP User Integration. Next challenge is to include Sensei My Courses & Pippin's AffiliateWP on these tabs.
<?php
/**
* My Account page
*
* @author WooThemes
* @edited by McLane Creative
* @package WooCommerce/Templates
* @version 3.1.0
*/
@mclanecreative
mclanecreative / style.css
Last active January 3, 2016 14:58
Childhood Lost College CSS
/* Credits
v 1.1
Childhood Lost College Version, World Vision
Theme customizations: Adam McLane
Github revision repository: https://gist.github.com/mclanecreative/6237117
*/
/* Header */
#logo {
@mclanecreative
mclanecreative / widget-woo-componentbase.php
Created December 20, 2013 03:42
Adds support for The Events Calendar within the components widget of WooThemes. Add this file into your child theme folder at: ...child-theme-name/includes/widgets/
<?php
/*-----------------------------------------------------------------------------------
CLASS INFORMATION
Description: A custom WooThemes Component widget.
Date Created: 2011-07-27.
Last Modified: 2011-07-27.
Author: WooThemes.
Forked: Adam McLane
@mclanecreative
mclanecreative / homepage-event-panel.php
Last active December 31, 2015 11:28
Adds an events panel to WooThemes homepage component. To add functionality for The Events Calendar into the theme options, drop this file into a child theme of any WooThemes theme. Example: ...child-theme-name/includes/homepage-event-panel.php
<?php
/**
* Homepage Events Panel
* Created by Adam McLane
*/
/**
* The Variables
*
* Setup default variables, overriding them if the "Theme Options" have been saved.
@mclanecreative
mclanecreative / theme-options
Last active December 31, 2015 11:09
To add the events tab to call The Events Calendar, insert this snippet this in your child theme folder. (...child-theme-name/includes/theme-options.php) For me this was after line 501.
$options[] = array( "name" => __('Events Area', 'woothemes'),
"type" => "subheading" );
$options[] = array( "name" => __('Number of Event items', 'woothemes'),
"desc" => __('Select the number of events that should appear in the event area on the home page.', 'woothemes'),
"id" => $shortname."tribe_entries",
"std" => "3",
"type" => "select",
"options" => $other_entries);
add_filter('woocommerce_email_footer_text','add_ip_to_email_footer', 10, 1);
function add_ip_to_email_footer( $footer ){
return $footer . ' | User IP: ' . getRealIPAddress();
}
function getRealIPAddress(){
if (!empty($_SERVER['HTTP_CLIENT_IP'])){
@mclanecreative
mclanecreative / style.css
Last active December 31, 2015 02:19
Urban Youth Workers Institute - Theme
-/*
Theme Name: UYWI-2014
Theme URI: http://uywi.org/
Description: Urban Youth Workers Institute - 2014
Author: Adam McLane
Author URI: http://theyouthcartel.com
Template: whitelight
Version: 0.4.6
*/