Skip to content

Instantly share code, notes, and snippets.

View j-mccarthy's full-sized avatar
💭
passing by

John McCarthy j-mccarthy

💭
passing by
  • flowethic
  • United Kingdom
View GitHub Profile
<?php // <- Remove <?php if your using this snippet
genesis_unregister_layout( 'sidebar-sidebar-content' );
<?php // <- Remove <?php if your using this snippet
genesis_set_default_layout( 'top-sidebar-content-sidebar' );
<?php // <- Remove <?php if your using this snippet
// Register New Layout
function jm_custom_layout() {
genesis_register_layout( 'layout-name', array(
'label' => __('custom/layout/name', 'genesis'),
'img' => get_bloginfo('stylesheet_directory') . '/images/yourlayout.gif'
) );
}
add_action( 'init', 'jm_custom_layout' );
<?php
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
<?php
/**
* Adding Html Blocks in Genesis Hooks
*
* @package Genese Gists
* @since 0.0.1
* @link
* @author John McCarthy <[email protected]>
* @copyright Copyright (c) 2014, John McCarthy
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
@j-mccarthy
j-mccarthy / gulpfile.js
Last active August 29, 2015 14:08 — forked from franksmule/gulpfile.js
Gulp Files
//*********** IMPORTS *****************
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var gutil = require('gulp-util');
var rename = require("gulp-rename");
var map = require("map-stream");
var livereload = require("gulp-livereload");
var concat = require("gulp-concat");
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
{
"name": "MyProject",
"version": "1.0.0",
"dependencies": {
"gulp": "*",
"gulp-ruby-sass": "*",
"gulp-util": "*",
"gulp-rename": "*",
"map-stream": "*",
"gulp-livereload": "*",
@j-mccarthy
j-mccarthy / wp-functionssnippets.php
Last active August 29, 2015 13:58
Wordpress Functions Snippets
<?php
// re-order child style
function src_reorder_child_style() {
wp_dequeue_style( 'responsive-style-css' );
wp_deregister_style( 'responsive-style-css');
wp_enqueue_style( 'child-style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'src_reorder_child_style', 20 );
<!-- Open New window onclick Javasript method -->
<a href="http://chriscoyier.net" onclick="window.open(this.href); return false;" onkeypress="window.open(this.href); return false;">This link will open in new window/tab</a>
<!-- Open New window onclick HTML5 method -->
<a href="http://chriscoyier.net" target="_blank">This link will open in new window/tab</a>
@j-mccarthy
j-mccarthy / CSSSnippets.css
Last active August 29, 2015 13:57
CSS Snippets
.centerimgindiv {
margin-left: auto;
margin-right: auto;
display:block;
}
/*No Wrap Floats!!!*/
p {
overflow:hidden;
}