Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
jamiemitchell / function.php
Created June 17, 2018 07:22 — forked from Komock/function.php
Genesis remove .site-inner markup
<?php
//* Remove .site-inner
add_filter( 'genesis_markup_site-inner', '__return_null' );
add_filter( 'genesis_markup_content-sidebar-wrap_output', '__return_false' );
add_filter( 'genesis_markup_content', '__return_null' );
?>
jQuery( document ).ready( function( $ ) {
jQuery( '.content' ).masonry();
} );
jQuery( 'img' ).load(function() {
jQuery( '.content' ).masonry();
} );
$(document).ready(function() {
var body = $('body');
var hamburger = $('.offscreen-menu-toggle');
var nav = $('.off-screen-content');
hamburger.click(function() {
nav.toggleClass('open');
hamburger.toggleClass('active');
body.toggleClass('no-scroll');
@jamiemitchell
jamiemitchell / style.css
Created April 6, 2018 00:24
Create beautiful css underlines for links.
.entry-content a {
color: #232323;
text-decoration: none;
background: linear-gradient(#fff,#fff),linear-gradient(#fff,#fff),linear-gradient(#d43c67,#d43c67);
background-repeat: no-repeat,no-repeat,repeat-x;
background-position: 0 95%,100% 95%,0 95%;
background-size: .05em 1px,.05em 1px,1px 1px;
text-shadow: 0.03em 0 #fff, -0.03em 0 #fff, 0 0.03em #fff, 0 -0.03em #fff, 0.06em 0 #fff, -0.06em 0 #fff, 0.09em 0 #fff, -0.09em 0 #fff, 0.12em 0 #fff, -0.12em 0 #fff, 0.15em 0 #fff, -0.15em 0 #fff;
}
@jamiemitchell
jamiemitchell / get-woocommerce-categories.php
Created April 5, 2018 01:58 — forked from rajeebbanstola/get-woocommerce-categories.php
Simple way to fetch WooCommerce Categories with Image and Description
<?php
$get_featured_cats = array(
'taxonomy' => 'product_cat',
'orderby' => 'name',
'hide_empty' => '0',
'include' => $cat_array
);
$all_categories = get_categories( $get_featured_cats );
$j = 1;
@jamiemitchell
jamiemitchell / remove-standard-and-load-custom-genesis-sidebar.php
Created April 2, 2018 03:48 — forked from duroe5698/remove-standard-and-load-custom-genesis-sidebar.php
Remove Primary Sidebar and Replace with Custom Sidebar Genesis Framework Snippet
<?php
//* Insert into custom page template to remove primary sidebar and replace with your custom sidebar.
function md_do_sidebar() {
dynamic_sidebar( 'SIDEBAR ID' );
}
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_action( 'genesis_sidebar', 'md_do_sidebar' );
?>
@jamiemitchell
jamiemitchell / Genesis Custom Sidebar
Created April 2, 2018 03:35 — forked from jacobwise/Genesis Custom Sidebar
Switch Genesis Primary sidebar for a custom sidebar
<?php
//* Remove Primary Sidebar if blog, single, or CPT
add_action( 'get_header', 'jw_remove_primary_sidebar' );
function jw_remove_primary_sidebar() {
if ( is_singular( 'post' ) || is_home() || is_singular( 'code' ) || is_singular( 'tutorial' ) || is_archive() ) {
/** Remove default sidebar */
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize search form input box text
add_filter( 'genesis_search_text', 'sp_search_text' );
function sp_search_text( $text ) {
return esc_attr( 'Search my blog...' );
}
@jamiemitchell
jamiemitchell / search_shortcode.php
Created March 29, 2018 22:06 — forked from cdils/search_shortcode.php
This is a modified extract from Bill Erickson's Genesis 404 Page plugin (https://github.com/billerickson/Genesis-404-Page). This bit of code adds shortcode support for a search form within a Genesis page or post.
<?php
add_action( 'init', 'cd_register_shortcode' );
/**
* Register shortcode with the theme
*/
function cd_register_shortcode() {
add_shortcode( '404-search', 'cd_search_shortcode' );
}
@jamiemitchell
jamiemitchell / style-front.css
Created March 26, 2018 01:22
Genesis Flexible Widgets
@media only screen and (min-width: 960px) {
/* Flexible Widgets
--------------------------------------------- */
.flexible-widgets .widget {
float: left;
margin-left: 3%;
}