Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean Langlands seanlanglands

View GitHub Profile
@seanlanglands
seanlanglands / cta-block-pattern.php
Last active Jul 21, 2022
Example block pattern that's based on a cover block featuring move and remove locking attributes.
View cta-block-pattern.php
<?php
$default_attachment_url = get_stylesheet_directory_uri() . '/assets/images/default-cover-bg.jpg';
$block_pattern_content = '<!-- wp:cover {"url":"' . esc_url( $default_attachment_url ) . '","id":42,"dimRatio":90,"minHeight":0,"minHeightUnit":"px","gradient":"vivid-cyan-blue-to-vivid-purple","align":"full","style":{"spacing":{"padding":{"top":"5rem","right":"14rem","bottom":"5rem","left":"14rem"}}}} -->
<div class="wp-block-cover alignfull" style="padding-top:5rem;padding-right:14rem;padding-bottom:5rem;padding-left:14rem;min-height:0px">
<span aria-hidden="true" class="has-background-dim-90 wp-block-cover__gradient-background has-vivid-cyan-blue-to-vivid-purple-gradient-background has-background-dim has-background-gradient"></span>
<img class="wp-block-cover__image-background wp-image-42" alt="" src="' . esc_url( $default_attachment_url ) . '" data-object-fit="cover"/>
<div class="wp-block-cover__inner-container">
<!-- wp:heading {"textAlign":"center","level":4,"style":{"spacing":{"margin":{"top"
@seanlanglands
seanlanglands / theme.json
Created Mar 28, 2022
Example theme.json for an existing Classic Theme that excludes many default color and typography controls from being enabled.
View theme.json
{
"schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"layout": {
"contentSize": "800px",
"wideSize": "1000px"
},
"color": {
"link": false