Skip to content

Instantly share code, notes, and snippets.

View mjsdiaz's full-sized avatar

Marcy Diaz mjsdiaz

View GitHub Profile
@mjsdiaz
mjsdiaz / filter-gallery-shortcode
Created October 28, 2013 20:59
Use shortcode_atts_gallery filter to add new defaults to the WordPress gallery shortcode. Use image size of medium and 2 columns as new defaults. Allows user input to the post gallery shortcode.
@mjsdiaz
mjsdiaz / functions.php
Last active January 15, 2016 20:27
Genesis Layout Full Height Sidebar with Header above Content and Footer Below Content
<?php
//* Do NOT include the opening php tag
// Add the code below to the functions.php of the Genesis Sample 2.0.1 theme
// Force sidebar-content-sidebar layout setting
add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content_sidebar' );
// Unregister layout settings
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar' );
@mjsdiaz
mjsdiaz / invoice-template.php
Last active January 3, 2016 23:29
How to Create a Genesis Theme Template for iThemes Exchange Invoices --- http://amethystwebsitedesign.com/how-to-create-a-genesis-template-for-ithemes-exchange-invoices/
<?php
/**
*
* Template Name: Exchange Invoice
*
*
* @package Templates
* @subpackage Exchange Invoice
* @author Marcy Diaz, Amethyst Website Design
* @license GPL-2.0+
//Enqueue the Dashicons script
add_action( 'wp_enqueue_scripts', 'amethyst_enqueue_dashicons' );
function amethyst_enqueue_dashicons() {
wp_enqueue_style( 'amethyst-dashicons-style', get_stylesheet_directory_uri(), array('dashicons'), '1.0' );
}
// Optional Custom entry meta in entry header - remove "by""
add_filter( 'genesis_post_info', 'amethyst_filter_post_info' );
function amethyst_filter_post_info($post_info) {
$post_info = '[post_date] [post_author_posts_link] [post_comments] [post_edit]';
<?php
// Note: Add only code below to your functions.php
add_action( 'wp_enqueue_scripts', 'amethyst_enqueue_scripts' );
function amethyst_enqueue_scripts() {
//Add mobile button script to Header Right widget navigation menu
wp_enqueue_script( 'header_nav_for_mobile', get_bloginfo( 'stylesheet_directory' ) . '/scripts/header-mobile-nav.js', array('jquery'), '1.0.0' );
}
/* Editor Stylesheet for Genesis Sample 2.0.1
--------------------------------------------- */
/* Import Google Fonts */
@import url('//fonts.googleapis.com/css?family=Lato:300,700');
.content {
color: #666;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 16px;
/* Put Read more link on it's own line */
a.more-link {
display: table;
} /* optional */
a.more-link {
display: block;
} /* optional */
/* Remove right arrow from Twenty Twelve read more links */
@mjsdiaz
mjsdiaz / exchange-style.css
Created June 26, 2014 19:29
Genesis Template for iThemes Exchange Category layout similar to the store
/* Added Taxonomy page identical to store */
.tax-it_exchange_category .it-exchange-products {margin: 0;padding: 0;}
.tax-it_exchange_category .it-exchange-products li {list-style: none;display: block;float:left;width: 45%;margin: 0 0 5em 0;vertical-align: top;}
.tax-it_exchange_category .it-exchange-products li:nth-child(2n+1) {margin-right: 5%;clear:both;}
.tax-it_exchange_category .it-exchange-product-details {padding: 1em;overflow:hidden;}
.tax-it_exchange_category .it-exchange-product-title {font-size: 1.5em;margin: .5em 0;padding: 0;}
.tax-it_exchange_category .it-exchange-product-title a {text-decoration: none;}
.tax-it_exchange_category .it-exchange-base-price {font-size: 1.25em;float:left;}
.tax-it_exchange_category .it-exchange-product-permalink {float:right;line-height: 2;}
.tax-it_exchange_category .featured-image-wrapper img {max-width: 100%; height: auto;}
<?php
/**
* The custom template for the Design category for Modern Portfolio Pro
*/
//* Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove the entry meta in the entry header
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
<?php //Don't add this line
//* Add support for 3-column footer widgets
// add_theme_support( 'genesis-footer-widgets', 3 );
//* Add support for 1-column footer widgets
add_theme_support( 'genesis-footer-widgets', 1 );