Skip to content

Instantly share code, notes, and snippets.

View mjsdiaz's full-sized avatar

Marcy Diaz mjsdiaz

View GitHub Profile
/* Center logo and menu on only large screens. */
@media only screen and (min-width: 960px) {
.wp-custom-logo .title-area,
.wp-custom-logo .nav-primary {
float: none;
}
.wp-custom-logo .title-area {
margin: 0 auto;
@mjsdiaz
mjsdiaz / page_archive.php
Last active May 15, 2018 17:59
Genesis Archive template showing only blog posts
<?php
/**
*
* Template Name: Archive
*
* Adapted from Genesis Framework page_archive.php
*
* @category Amethyst-v2
* @package Templates
* @subpackage Archive
@mjsdiaz
mjsdiaz / page_archive.php
Created January 5, 2018 16:49
Genesis Archive page showing all pages, categories, recent posts, and portfolio items.
<?php
/**
*
* Template Name: Archive
*
* Adapted from Genesis Framework page_archive.php
*
* @category Amethyst-v2
* @package Templates
* @subpackage Archive
@mjsdiaz
mjsdiaz / modernizr-custom.css
Last active November 6, 2017 23:43
Using Modernizr for CSS object-fit on browsers that support it
/*! modernizr 3.3.1 (Custom Build) | MIT *
* http://modernizr.com/download/?-objectfit-setclasses !*/
!function(e,n,t){function r(e,n){return typeof e===n}function o(){var e,n,t,o,i,s,a;for(var f in g)if(g.hasOwnProperty(f)){if(e=[],n=g[f],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(o=r(n.fn,"function")?n.fn():n.fn,i=0;i<e.length;i++)s=e[i],a=s.split("."),1===a.length?Modernizr[a[0]]=o:(!Modernizr[a[0]]||Modernizr[a[0]]instanceof Boolean||(Modernizr[a[0]]=new Boolean(Modernizr[a[0]])),Modernizr[a[0]][a[1]]=o),y.push((o?"":"no-")+a.join("-"))}}function i(e){var n=_.className,t=Modernizr._config.classPrefix||"";if(w&&(n=n.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(r,"$1"+t+"js$2")}Modernizr._config.enableClasses&&(n+=" "+t+e.join(" "+t),w?_.className.baseVal=n:_.className=n)}function s(e){return e.replace(/([a-z])-([a-z])
@mjsdiaz
mjsdiaz / style.css
Last active November 4, 2017 11:51
Style Dropdown Select Menus in Chrome – Square Corners and Height - https://amethystwebsitedesign.com/style-dropdown-select-menus-in-chrome-square-corners-and-height
/* Default theme form styles, similar to Genesis Sample */
input,
select,
textarea {
background-color: #fff;
border: 1px solid #ccc;
color: #545454;
font-size: 18px;
font-size: 1.8rem;
font-weight: 400;
@mjsdiaz
mjsdiaz / functions.php
Last active September 8, 2017 21:25
WordPress Menu Order Sort for Adjacent Previous - Next Single Post Navigation - https://amethystwebsitedesign.com/wordpress-menu-order-sort-for-adjacent-previous-next-single-post-navigation
<?php
// Do NOT add the line above when you copy.
/** Add previous/next post navigation on book posts.
* http://snipplr.com/view/74493/adjacent-post-by-alphabetical-order-in-wordpress/
* /wp-includes/link-template.php
* line 1608
* $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms );
* line 1620
* $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" );
//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 //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 );
/* 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 / 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' );