which CSS selectors to use? this shows all the (non-dynamic) options generated from your project's tailwind.config.js
.
rogden/tailwind-config-viewer is the best. run from the command line:
npx tailwind-config-viewer -o
which CSS selectors to use? this shows all the (non-dynamic) options generated from your project's tailwind.config.js
.
rogden/tailwind-config-viewer is the best. run from the command line:
npx tailwind-config-viewer -o
/** | |
* Block Editor Settings. | |
* Add custom colors and gradients to the editor. | |
*/ | |
function tabor_add_colors_and_gradients() { | |
$colors = array( | |
'primary' => '#db1c7d', | |
'secondary' => '#a528f0', | |
'tertiary' => '#90cbff', |
function tabor_register_block_categories() { | |
if ( class_exists( 'WP_Block_Patterns_Registry' ) ) { | |
register_block_pattern_category( | |
'hero', | |
array( 'label' => _x( 'Hero', 'Block pattern category', 'textdomain' ) ) | |
); | |
} | |
} |
function block_variation_example_enqueue() { | |
wp_enqueue_script( | |
'block-variation-example-script', | |
plugins_url( 'index.js', __FILE__ ), | |
array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ), | |
filemtime( plugin_dir_path( __FILE__ ) . '/block-variation-example.js' ) | |
); | |
} | |
add_action( 'enqueue_block_editor_assets', 'block_variation_example_enqueue' ); |
wp.domReady( function() { | |
wp.blocks.registerBlockVariation( 'coblocks/form', { | |
name: 'event-registration', | |
title: 'Event Registration', | |
icon: '<svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg"><path d="m18 10h-14v2h14zm2-8h-1v-2h-2v2h-12v-2h-2v2h-1c-1.11 0-1.99.9-1.99 2l-.01 16c0 1.1.89 2 2 2h18c1.1 0 2-.9 2-2v-16c0-1.1-.9-2-2-2zm0 18h-18v-13h18zm-5-5h-6-5v2h11z" transform="translate(13 14)"/></svg>', | |
innerBlocks: [ | |
[ 'coblocks/field-name', { label: 'Full name', hasLastName: true } ], | |
[ 'coblocks/field-email', { required: true } ], | |
[ 'coblocks/field-radio', { label: 'How do you use WordPress?', required: true, options: [ 'I write', 'I design', 'I develop', 'I manage', 'I am new to WordPress!'] } ], | |
[ 'coblocks/field-checkbox', { label: 'I’m on a gluten-free diet', options: [ 'Yes', 'No' ], required: true } ], |
/* I'll put here different examples of dynamic query for Oxygen repeater : | |
* - Use one of the following repeater_dynamic_query definitions | |
* in code block just BEFORE the repeater | |
* - Set the repeater custom query settings : post type, number of posts, order... | |
* - Add the remove_action in a code block AFTER the repeater | |
*/ | |
/**************************************************************************************************** | |
* Display related posts for any CPT with taxonomy: |
/** | |
* Add Oxygen's global colors to Gutenberg's backend editor palette | |
*/ | |
function pavenum_gutenberg_oxygen_palette() { | |
$gutenberg_colors = []; | |
$oxy_colors = oxy_get_global_colors(); | |
foreach( $oxy_colors['colors'] as $oxy_color) { | |
$gutenberg_colors[] = [ 'name' => $oxy_color['name'], 'slug' => 'color-' . $oxy_color['id'], 'color' => $oxy_color['value'] ]; |
<?php /* Template Name: Awesome Page */ | |
get_header(); | |
?> | |
<div class="latest-posts"></div> | |
<script> |
<?php | |
if ( has_block( 'blockgallery/masonry' ) ) { | |
// Do something, if the Block Gallery Masonry block is added to this page. | |
} |