Skip to content

Instantly share code, notes, and snippets.

View ejntaylor's full-sized avatar
🚢
Shipping

Elliot ejntaylor

🚢
Shipping
View GitHub Profile
@ejntaylor
ejntaylor / custom.css
Last active August 29, 2015 13:57
CSS for Canvas breakpoints - retains full-width header
/* Header Items and Content Items and Footer Items*/
#content.col-full, #header, .nav-cont, #wrapper, #footer-widgets {
margin-left: auto;
margin-right: auto;
}
@media only screen and (min-width: 960px){
/*
*
@ejntaylor
ejntaylor / gist:9990392
Created April 5, 2014 10:56
For use on Woo Canvas, WooCommerce and Yoast SEO
// Replace WooThemes Breadcrumbs with Yoast breadcrumbs
add_action( 'init', 'hh_breadcrumbs' );
function hh_breadcrumbs() {
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
add_action( 'woocommerce_before_main_content','hh_yoast_breadcrumb', 20, 0);
function hh_yoast_breadcrumb() {
if ( function_exists('yoast_breadcrumb') && !is_front_page() ) {
yoast_breadcrumb('<p class="breadcrumbs">','</p>');
@ejntaylor
ejntaylor / css.css
Last active August 29, 2015 13:58
Adds Top Menu toggle for Woo Canvas and Uber Menu
/* Responsive Top Nav Toggle */
#responsive-icons {
position: absolute; right: 0px; top:10px; z-index: 5000; font-size: 30px;
}
#responsive-icons a {
margin-right: 10px;
}
<?php
// Settings
global $BambooPlugin; // we'll need this below
$default_plugins = $BambooPlugin->get_setting('req_plugins_arr','array');
<?php
public function save_settings() {
if( isset($_REQUEST["{$this->prefix}_setting"]) && check_admin_referer("save_{$this->prefix}_settings","{$this->prefix}_save") ) {
$new_settings = $_REQUEST["{$this->prefix}_setting"];
foreach( $new_settings as $setting_name => $setting_value ) {
foreach( $setting_value as $type => $value ) {
echo '<br> t1 <br>';
if( is_array($value) ) {
//add placeholder for subscribe form
$(".widget_ns_mailchimp input").focus(function(){
showEmptyLabels();
$(this).siblings("label").stop().fadeOut();
});
$(".widget_ns_mailchimp input").blur(function(){
showEmptyLabels();
});
$(".widget_ns_mailchimp label").bind("click", function() {
$(this).siblings("div").find("input, textarea").focus();
# END WordPress
AuthType Basic
AuthName "restricted area"
AuthUserFile /home/rstage/public_html/.htpasswd
require valid-user
add_action ('template_redirect','hide_fe');
function hide_fe() {
if (!is_admin()) {
wp_redirect(admin_url('/', 'http'), 301);
}
@ejntaylor
ejntaylor / functions.php
Created November 3, 2014 14:20
Translate WooCommerce Text
<?php
// Cart - Basket Text
function wpa_change_my_basket_text( $translated_text, $text, $domain ){
if( $domain == 'woothemes' && $translated_text == 'Cart:' )
$translated_text = 'Basket:';
return $translated_text;
}
@ejntaylor
ejntaylor / functions.php
Created March 20, 2015 10:55
Example: Add SEO content to home page
<?php
// add home page content
add_action ('after_primary','custom_homepage_content');
function custom_homepage_content() {
if (is_front_page()) {