View colorPaletteExample.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { InspectorControls, useSetting } from '@wordpress/block-editor'; | |
import { PanelBody, PanelRow, ColorPalette } from '@wordpress/components'; | |
const Edit = () => { | |
const { bgColor } = attributes; | |
const colors = useSetting( 'color.palette' ) || []; | |
return ( | |
<> |
View gist:13dcfe7796c7e76fe55fc5fe10d49cca
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Fonts | |
*/ | |
// Body font | |
$primary-font: 'Lato', sans-serif; | |
$header-font: $primary-font; | |
// Font Weights | |
$font-light: 400; |
View helper-example.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.angled-element { | |
@include angled-top-left; | |
@include angled-bottom-right; | |
} |
View angled-helpers.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin angled-top-left( $background-color: $primary-brand-color ) { | |
@include angled( $background-color: $background-color, $top: true, $bottom: false, $reversed: false ); | |
} | |
@mixin angled-top-right( $background-color: $primary-brand-color ) { | |
@include angled( $background-color: $background-color, $top: true, $bottom: false, $reversed: true ); | |
} | |
@mixin angled-bottom-left( $background-color: $primary-brand-color ) { | |
@include angled( $background-color: $background-color, $top: false, $bottom: true, $reversed: true ); |
View advanced-angled-mixin.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin angled( $background-color, $top: true, $bottom: true, $reversed: false, $height: '1.5deg' ) { | |
position: relative; | |
@if $top { | |
&::before { | |
display: block; | |
position: absolute; | |
top: 0; | |
left: 0; | |
content: ''; |
View simple-angled-mixin.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin angled( $background-color, $reversed: false, $height: '1.5deg' ) { | |
position: relative; | |
&::before, | |
&::after { | |
display: block; | |
background-color: $background-color; | |
right: 0; | |
content: ''; | |
height: 50%; |
View display_select_featured.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_entry_header', 'featured_post_image', 8 ); | |
/** | |
* Conditionally add the post thumbnail to single post | |
*/ | |
function featured_post_image() { | |
if ( ! is_singular( 'post' ) ) | |
return; | |
View display_featured_image.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_before_entry', 'featured_post_image', 8 ); | |
/** | |
* Add the post thumbnail to single post | |
*/ | |
function featured_post_image() { | |
if ( ! is_singular( 'post' ) ) | |
return; | |
View force_https_set_url_scheme.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'set_url_scheme', 'lc_force_secure_scheme', 10, 3 ); | |
/** | |
* Force all URLs run through the set_url_scheme to always be https if they're | |
* being accessed through our reverse proxy. | |
* | |
* @param string $url The complete URL including scheme and path. | |
* @param string $scheme Scheme applied to the URL. One of 'http', 'https', or 'relative'. | |
* @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login', | |
* 'login_post', 'admin', 'relative', 'rest', 'rpc', or null. |
View create reverse-proxy-conditional.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Conditional to check if we're being served via the Reverse Proxy. | |
* The URL for the Forwarded Server below (example.com) should be the final | |
* URL for the site using the Reverse Proxy. | |
*/ | |
function lc_is_reverse_proxy() { | |
if ( 'www.example.com' === $_SERVER['HTTP_X_FORWARDED_SERVER'] ) { | |
return true; |
NewerOlder