Skip to content

Instantly share code, notes, and snippets.

View mclanecreative's full-sized avatar

adam mclane mclanecreative

View GitHub Profile
@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 / 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 / espn-inspired-prompt-css
Last active December 14, 2015 19:59
/// WordPress hack /// Fashioned after ESPN Insider, this function is intended to prompt non-members to join a WordPress site. This code will be created in a way which the administrator can copy/paste the snippet into function.php, customize the graphic/URLs, and style via CSS. For this usage, we'll hide/show content with S2member pro. But any m…
/* = Stuff added for the login/logout
-------------------------------------------------------------- */
.well-join {
display: block;
background-image: url(http://uywi.org/wp-content/uploads/2013/03/theWell_JoinBoxR02.jpg);
background-repeat:no-repeat;
height:300px;
width:760px;
text-indent:-9999px;
padding-top:.7em;
@mclanecreative
mclanecreative / hello-darth.php
Last active December 14, 2015 21:18
This little WordPress plugin is in homage to my geek friends who love to hate Lord Vader.
<?php
/**
* @package Hello_Darth
* @version 0.2
*/
/*
Plugin Name: Hello Darth
Plugin URI: http://wordpress.org/extend/plugins/hello-darth/
Description: This little plugin is in homage to my geek friends who love to hate Lord Vader. When activated you will randomly see a quote from <a href="http://www.imdb.com/character/ch0000005/quotes">Darth Vader's IMDB page</a> in the upper right of your admin screen on every page. HT to <a href="http://ma.tt">Matt Mullenberg</a> for the original code. <a href="https://wordpress.org/support/plugin/hello-darth">Support and suggestions</a> are welcome.
Author: Adam McLane | @mclanecreative
@mclanecreative
mclanecreative / wp-responsive-navigation
Created May 4, 2013 21:06
A base for dropping in responsive elements for a theme, specifically pulling out the standard navigation and dropping in a mobile navigation
/* ======================================================= */
/* Responsive Nav Queries - Swaps normal Nav with a dropdown menu with the #responsive-nav ID */
/* ======================================================= */
#responsive-nav{display: none; float: right;}
#responsive-nav li{clear: both;}
/* @media only screen
and (max-width: 960) {
.navigation ul.sf-menu { display: none; }
@mclanecreative
mclanecreative / style.css
Last active December 21, 2015 02:48
Childhood Lost Theme CustomizationsMostly trying to capture the progress and keep changes in a safe place between nightly backups.
/* Credits
v 1.13
Childhood Lost, World Vision
Theme customizations: Adam McLane
Github revision repository: https://gist.github.com/mclanecreative/6237117
*/
/* Header */
#logo {
<?php /*
Template Name: Home
*/ ?>
<?php get_header(); ?>
<div id="content" class="full">
<?php get_template_part( 'part-projects-home'); ?>
<div id="progress_report"><span class="home-progress-signup"><a href="#">SIGN UP</a></span><br /><p><span class="home-progress-learnmore"><a href="#">OR LEARN MORE</a></span></p>
<h1>Progress Report</h1><br /><h4>Vivamus condimentum eleifend vehicula. Maecenas pulvinar tellus velit, sed consectetur lorem porttitor eget. Nam sagittis tempor tristique.</h4>
<p><h6>OUR PROJECT GOAL = <strong>$300,000</strong></h6></p></div>
<div id="fundraise_report"><div id="progress_table">
@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
*/
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 / 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);