Skip to content

Instantly share code, notes, and snippets.

View mjsdiaz's full-sized avatar

Marcy Diaz mjsdiaz

View GitHub Profile
<?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 // Do not add this line
// Reduce the primary navigation menu to two levels depth.
add_filter( 'wp_nav_menu_args', 'genesis_sample_primary_menu_args' );
function genesis_sample_primary_menu_args( $args ) {
if ( 'primary' != $args['theme_location'] ) {
return $args;
}
@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' );
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
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 / 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 / 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 / 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 / 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 / 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+
*/