Skip to content

Instantly share code, notes, and snippets.

@shawnabroyles
shawnabroyles / gutenberg-sample-content.html
Created March 4, 2022 00:04 — forked from mailenkno/gutenberg-sample-content.html
WordPress Gutenberg Sample Content
<!-- wp:paragraph {"align":"center","customTextColor":"#000000","backgroundColor":"very-light-gray","fontSize":"small"} -->
<p style="color:#000000;text-align:center" class="has-background has-small-font-size has-very-light-gray-background-color">Gutenberg Sample Content.<br/>Put together with ❤️ by <a href="https://artisanthemes.io/">Artisan Themes</a>.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":1} -->
<h1>This is a heading (H1)</h1>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>This is a heading (H2)</h2>
@shawnabroyles
shawnabroyles / Vipo - Styleguide
Created February 4, 2022 04:51 — forked from liviucerchez/Vipo - Styleguide
Vipo - Styleguide
<!-- wp:heading {"className":"text-uppercase"} -->
<h2 class="text-uppercase">01. Grid</h2>
<!-- /wp:heading -->
<!-- wp:columns {"className":"has-6-columns"} -->
<div class="wp-block-columns has-6-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:html -->
<div style="height:120px;background-color:#f2f2f2;box-shadow: 0 -4px 0 0 rgba(32,32,32,.1) inset;"></div>
<!-- /wp:html --></div>
<!-- /wp:column -->
@shawnabroyles
shawnabroyles / functions.php
Created February 1, 2022 23:06 — forked from pattyok/functions.php
Add Background Support to Cover Block
add_filter( 'block_type_metadata_settings', 'filter_metadata_registration', 10, 2 );
public function filter_metadata_registration( $settings, $metadata ) {
if ( 'core/cover' == $metadata['name'] ) {
if ( is_array( $settings['supports']['color'] ) ) {
$settings['supports']['color']['background'] = true;
} else {
$settings['supports']['color'] = array(
@shawnabroyles
shawnabroyles / change_genesis_menu_settings.php
Created July 26, 2021 09:18 — forked from remkus/change_genesis_menu_settings.php
Change the Genesis Theme Menu Settings
<?php
add_filter( 'genesis_theme_settings_menu_ops', 'fsm_change_genesis_theme_menu' );
/**
* Change Genesis Dashboard Menu Settings
* @param object $menu_ops Menu arguments object
* @return object $menu_ops Ammended menu arguments object
* @author Remkus de Vries
* @link https://gist.github.com/defries/4296462
*
@shawnabroyles
shawnabroyles / pbdc2020-custom-functions.php
Created July 19, 2021 21:31 — forked from nathaningram/pbdc2020-custom-functions.php
PBDC 2020 - Custom Functions Plugin
<?php
/*
Plugin Name: My Awesome Custom Functions Plugin
Plugin URI: https://nathaningram.com
Description: A set of custom functions for client websites from Nathan Ingram's Page Builder Developer Course Nov 2020
Version: 1.0
Author: Nathan Ingram
Author URI: https://nathaningram.com
License: GPL2
*/
<?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.
@shawnabroyles
shawnabroyles / gist:4680915c4f365f52a39b10394dfde98c
Created July 17, 2021 03:19 — forked from jaredatch/gist:aea2fe3777b490bc927b
Merge secondary menu into primary for mobile
jQuery(document).ready(function($){
function mobile_combine_nav() {
$('.nav-header li.secondary-item').remove();
if ( $('.nav-secondary').css( 'display' ) == 'none' ) {
$('.nav-secondary li').addClass('secondary-item').clone().appendTo('.nav-header ul');
}
}
mobile_combine_nav();
$(window).resize(mobile_combine_nav);
});
<?php
//* Do NOT include the opening php tag
//* Add multiple grid loops to a page template*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
function custom_do_grid_loop() {
$args = array(
<?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' )
) );