Skip to content

Instantly share code, notes, and snippets.

View colorful-tones's full-sized avatar
💓
Don’t believe the hype!

Damon Cook colorful-tones

💓
Don’t believe the hype!
View GitHub Profile
<?php
/**
* This file adds functions to the child WordPress theme.
*/
/**
* Check for Notification Bar, and display it.
*/
function demo_acf_output_notification() {
$has_notice = get_field( 'notification_bar', 'options' );
name: Deploy to a WP Engine Development environment
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@colorful-tones
colorful-tones / .gitignore
Last active February 27, 2025 18:17
An example .gitignore optimized for WP Engine hosting
#----------------------------------------
# This Git ignore should be located
# in your WordPress install's wp-content/
# directory.
#----------------------------------------
#---------------------------
# WordPress general
#---------------------------
/index.php
function qorp_about_block_template_lookup( $template, $type, array $templates ) {
if ( $template && 'page-about.php' === $templates[0] ) {
add_filter( 'the_content', 'qorp_append_post_meta_output' );
}
}
add_filter( 'page_template', 'qorp_about_block_template_lookup', 20, 3 );
function qorp_append_post_meta_output( $content ) {
ob_start();
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header"} /-->
<!-- wp:group {"tagName":"main","className":"site-content","style":{"spacing":{"margin":{"top":"0"}}}} -->
<main class="wp-block-group site-content" style="margin-top:0">
<!-- wp:pattern {"slug":"frost/page-home"} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer"} /-->
@colorful-tones
colorful-tones / Gutenberg Style Guide
Last active November 28, 2023 11:02
A simple style guide for Gutenberg FSE theme development
<!-- wp:spacer {"height":"150px"} -->
<div style="height:150px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:group {"align":"wide","layout":{"inherit":false}} -->
<div class="wp-block-group alignwide"><!-- wp:columns {"verticalAlignment":"center"} -->
<div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","style":{"spacing":{"padding":{"top":"3rem","right":"1rem","bottom":"3rem","left":"1rem"}},"border":{"width":"1px"}},"backgroundColor":"contrast","className":"has-border-color has-black-border-color"} -->
<div class="wp-block-column is-vertically-aligned-center has-border-color has-black-border-color has-contrast-background-color has-background" style="border-width:1px;padding-top:3rem;padding-right:1rem;padding-bottom:3rem;padding-left:1rem"><!-- wp:paragraph {"textColor":"base","fontSize":"small"} -->
<p class="has-base-color has-text-color has-small-font-size">Contrast</p>
<!-- /wp:paragraph --></div>
@colorful-tones
colorful-tones / block.json
Last active August 11, 2021 16:36
Block template for InnerBlocks
{
"apiVersion": 2,
"name": "namespace/carousel",
"title": "Carousel",
"category": "custom-category",
"icon": "slides",
"keywords": [ "carousel", "slider" ],
"description": "Add a swipeable carousel of content.",
"supports": {
"html": false
@colorful-tones
colorful-tones / arrow-left.js
Last active July 2, 2021 17:08
SVG Icon block
import { SVG, Path } from '@wordpress/components';
const arrowLeft = (
<SVG fill="none" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<Path
d="m1.333 14.389 9.466-9.466c.872-.872 2.326-.872 3.198 0s.872 2.326 0 3.198l-5.589 5.621h20.677c1.26 0 2.262 1.002 2.262 2.261s-1.002 2.262-2.262 2.262h-20.677l5.589 5.589c.872.872.872 2.326 0 3.198-.452.452-1.034.678-1.615.678s-1.163-.226-1.615-.678l-9.434-9.434c-.42-.42-.678-1.002-.678-1.615s.226-1.195.678-1.615z"
fill="currentColor"
/>
</SVG>
);
@colorful-tones
colorful-tones / customizer.php
Last active March 17, 2020 04:40
Child theme for Go - includes custom Customizer options
<?php
/**
* Customizer setup
*
* @package YourChildTheme
*/
namespace YourChildTheme\Customizer;
/**
@colorful-tones
colorful-tones / gutenberg-sample-content.html
Last active February 21, 2019 00:36 — forked from mailenkno/gutenberg-sample-content.html
WordPress Gutenberg Sample Content
<!-- wp:heading {"level":1} -->
<h1>This is a heading (H1)</h1>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>This is a heading (H2)</h2>
<!-- /wp:heading -->
<!-- wp:heading {"level":3} -->
<h3>This is a heading (H3)</h3>