Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcy Diaz mjsdiaz

View GitHub Profile
View functions.php
<?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' );
}
View editor-style.css
/* 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;
@mjsdiaz
mjsdiaz / exchange-style.css
Created Jun 26, 2014
Genesis Template for iThemes Exchange Category layout similar to the store
View exchange-style.css
/* 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;}
@mjsdiaz
mjsdiaz / functions.php
Last active Aug 29, 2015
Edit genesis_html5_comment_callback to add link only around the date, and not the time
View functions.php
<?php
//* Remove the line above when copying to your functions.php
add_filter( 'genesis_comment_list_args', 'custom_comment_list_args' );
//* Filter the genesis_comment_list_args to add a custom callback function
function custom_comment_list_args( $args ) {
$args['callback'] = 'custom_comment_callback_no_date';
return $args;
}
@mjsdiaz
mjsdiaz / functions.php
Last active Aug 29, 2015
Edit genesis_html5_comment_callback to show only date with no time or link
View functions.php
<?php
//* Remove the line above when copying to your functions.php
add_filter( 'genesis_comment_list_args', 'custom_comment_list_args' );
//* Filter the genesis_comment_list_args to add a custom callback function
function custom_comment_list_args( $args ) {
$args['callback'] = 'custom_comment_callback_no_date';
return $args;
}
@mjsdiaz
mjsdiaz / functions.php
Created Sep 27, 2014
Add Post Meta (Categories and Tags) to Pages in Genesis Child Theme
View functions.php
<?php
//* Remove line above
//* Customize the entry meta in the entry footer
//* First install plugin Post Tags and Categories for Pages
add_action('genesis_entry_footer', 'custom_page_post_meta');
function custom_page_post_meta() {
if ( 'page' === get_post_type() ) {
@mjsdiaz
mjsdiaz / function1.php
Last active Aug 29, 2015
These snippets will remove the page title from an array of pages (Genesis Only)
View function1.php
<?php
// Remove page title on select pages; leaves entry_header_markup
// Instead of page slugs, you could substitute page IDs
add_action( 'genesis_entry_header', 'mb_remove_page_title', 5 );
function mb_remove_page_title() {
if ( is_page( array('home', 'real-estate', 'contact-me' ) ) ) {
remove_action('genesis_entry_header', 'genesis_do_post_title');
}
@mjsdiaz
mjsdiaz / style.css
Created Jan 17, 2015
Create Genesis Category and Tag Templates that Look Like iThemes Exchange Store - https://amethystwebsitedesign.com/create-genesis-category-template-like-ithemes-exchange-store
View style.css
/* iThemes Exchange
---------------------------------------------------- */
/** ---------:[ categories and tags store]:---------- */
.awd-it-exchange-tax-store .entry {
padding: 0;
margin: 0;
}
.awd-it-exchange-tax-store {
View function1-functions.php
<?php // Remove this line before adding to your functions.php or /exchange/functions.php
//Remove Genesis pagination from Exchange Store page
function my_remove_nav_in_store() {
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
}
add_action( 'it_exchange_content_store_after_wrap', 'my_remove_nav_in_store' );
@mjsdiaz
mjsdiaz / drop-down-nav.js
Last active Aug 29, 2015
Responsive Website Navigation for Genesis WordPress Themes - Primary and Secondary Navigation - https://amethystwebsitedesign.com/responsive-website-navigation-for-genesis-wordpress-themes/
View drop-down-nav.js
jQuery( function($) {
'use strict';
// Insert mobile menu icon before the primary navigation ul
$( '<div id="menu-primary-mobile">&#8801; Menu</div>' ).insertBefore( 'ul.menu-primary' );
// Add .displaynone class to ul.menu-primary to hide ul.menu-primary for small screen sizes
$( 'ul.menu-primary' ).addClass( 'displaynone' );