Skip to content

Instantly share code, notes, and snippets.

View mjsdiaz's full-sized avatar

Marcy Diaz mjsdiaz

View GitHub Profile
@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
/* 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 / smoms-mailbox.php
Created July 20, 2018 01:03
SMOMS Mailbox CPT
<?php
/**
* This registers the custom post type for the SMOMS mailbox content.
*
* @package SMOMS Custom Content
* @author Marcy Diaz <marcy@amethystwebsitedesign.com>
* @copyright 2018 Marcy Diaz
* @license GPL-2.0+
*/
@mjsdiaz
mjsdiaz / functions.php
Last active September 9, 2018 00:25
Use default avatars for author and others in comments
<?php // Do not add this to your functions.php.
/* Use default avatars for author and others in comments */
add_filter( 'get_avatar', 'agf_custom_avatars', 10, 3 );
function agf_custom_avatars( $avatar, $size ) {
if ( is_admin() ) {
$size = '48';
return $avatar;
@mjsdiaz
mjsdiaz / add-editor-layout-classes.js
Created January 28, 2019 23:10 — forked from nickcernis/add-editor-layout-classes.js
Add Genesis layout class to Gutenberg editor pages (admin)
// Add genesis layout classes to the Block Editor.
// File lives in the theme's /js/ folder.
wp.domReady(function () {
yourTheme.updateLayoutClass();
var layouts = document.querySelector(".genesis-layout-selector");
layouts.addEventListener("input", function (e) {
yourTheme.updateLayoutClass();
});
});
@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 / front-style.css
Created April 24, 2020 22:42
Front page style sheet for Agent Focused 1.0
/* Agent Focused Pro Front Page Styles */
/* Front Page Table of Contents
- Front Page General
- Titles
- Site Header
- Flexible Widgets
- Front Page 1
- Front Page Search Bar
- Front Page 2
@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' )
) );
The Steps to Take
1. First, we’ll comment out the sections that add the backstretch script.
2. Next we’ll add a new function to add the body background-image style, both in front-page.php.
3. And then we’ll add the positioning styles to style-front.css.
@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' );