Skip to content

Instantly share code, notes, and snippets.

View mjsdiaz's full-sized avatar

Marcy Diaz mjsdiaz

View GitHub Profile
@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" );
@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 / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mjsdiaz
mjsdiaz / functions.php
Last active December 15, 2020 23:11
Add Third or Footer Navigation Menu to Genesis Child Theme - https://amethystwebsitedesign.com/add-third-footer-navigation-menu-to-genesis-child-theme
<?php
// Remove the line above when adding to functions.php
// Add theme support for new menu
// Add New Footer Menu; Keep Primary and Secondary Menus
add_theme_support ( 'genesis-menus' , array (
'primary' => __( 'Primary Navigation Menu', 'genesis' ),
'secondary' => __( 'Secondary Navigation Menu', 'genesis' ),
'footer' => __( 'Footer Navigation Menu', 'genesis' )
) );
@mjsdiaz
mjsdiaz / drop-down-nav.js
Last active August 29, 2015 14:15
Responsive Website Navigation for Genesis WordPress Themes - Primary and Secondary Navigation - https://amethystwebsitedesign.com/responsive-website-navigation-for-genesis-wordpress-themes/
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' );
@mjsdiaz
mjsdiaz / function1-functions.php
Created January 26, 2015 18:46
Several Methods to Remove Genesis Pagination from iThemes Exchange Store Pages - https://amethystwebsitedesign.com/remove-genesis-pagination-from-ithemes-exchange-store-pages/
<?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 / style.css
Created January 17, 2015 00:28
Create Genesis Category and Tag Templates that Look Like iThemes Exchange Store - https://amethystwebsitedesign.com/create-genesis-category-template-like-ithemes-exchange-store
/* iThemes Exchange
---------------------------------------------------- */
/** ---------:[ categories and tags store]:---------- */
.awd-it-exchange-tax-store .entry {
padding: 0;
margin: 0;
}
.awd-it-exchange-tax-store {
@mjsdiaz
mjsdiaz / function1.php
Last active August 29, 2015 14:12
These snippets will remove the page title from an array of pages (Genesis Only)
<?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 / functions.php
Created November 24, 2014 18:54
Open Genesis Primary and Secondary Navigation with a Single Responsive Menu Icon - https://amethystwebsitedesign.com/open-genesis-primary-and-secondary-navigation-with-a-single-responsive-menu-icon/
<?php
//* Do NOT include the opening php tag
/* Edit (or add) the enqueue line for the responsive menu */
//* Enqueue Scripts
add_action( 'wp_enqueue_scripts', 'executive_load_scripts' );
function executive_load_scripts() {
wp_enqueue_script( 'executive-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
@mjsdiaz
mjsdiaz / functions.php
Created September 27, 2014 23:43
Add Post Meta (Categories and Tags) to Pages in Genesis Child Theme
<?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() ) {