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
(function () { | |
document.addEventListener("DOMContentLoaded", function () { // Wait for all the contents to load. | |
const elts = document.querySelectorAll("figure a"); // Select all video gallery links. | |
if (!elts.length) return; // If nothing, bail early. | |
[...elts].map((elt) => { // Loop over each link. | |
elt.addEventListener("click", function (e) { // Listen for a click on each gallery link. | |
console.log("Got a click on a gallery item."); | |
setTimeout(function () { // Wait for the iframe b/c it loads dynamically. | |
console.log("Overwriting the autoplay to 0!"); | |
let iElt = document.querySelector("iframe"); |
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
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
document.querySelectorAll("form.wpcf7-form > :not(.wpcf7-response-output)").forEach(el => { | |
el.style.display = 'none'; | |
}); | |
// Redirect on submission | |
setTimeout( () => { | |
location = '/my-redirect-page/'; // TO DO: Put your URL or slug here. | |
}, 3000 ); // Wait for 3 seconds to redirect. Change the delay to what you want. | |
}, false ); |
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 // Ignore this first line when copying to your child theme's functions.php file. | |
// Turn on font size & font family selects in the classic editor. | |
add_filter( 'mce_buttons_2', function( $buttons ) { | |
array_unshift( $buttons, 'fontselect' ); | |
array_unshift( $buttons, 'fontsizeselect' ); | |
return $buttons; | |
} ); | |
/** |
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
<!-- wp:group {"style":{"spacing":{"padding":{"right":"var:preset|spacing|10","left":"var:preset|spacing|10","top":"var:preset|spacing|10","bottom":"var:preset|spacing|10"}}},"backgroundColor":"accent","layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"},"contentControls":{"enabled":false,"rules":{}}} --> | |
<div class="wp-block-group has-accent-background-color has-background" style="padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)"><!-- wp:site-logo {"width":79,"shouldSyncIcon":true} /--> | |
<!-- wp:paragraph {"fontSize":"large","contentControls":{"enabled":false,"rules":{"user":{"userStatus":"logged_out","roleMatch":"any","userRoles":[]}}}} --> | |
<p class="has-large-font-size">Logged-out Menu</p> | |
<!-- /wp:paragraph --> | |
<!-- wp:navigation {"ref":56,"layout":{"type":"flex"},"fontSize":"large","contentControls":{"enabled":false,"rules":{"user":{"userStatus":"logge |
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
<!-- wp:columns --> | |
<div class="wp-block-columns"><!-- wp:column {"width":"30%"} --> | |
<div class="wp-block-column" style="flex-basis:30%"></div> | |
<!-- /wp:column --> | |
<!-- wp:column {"width":"40%"} --> | |
<div class="wp-block-column" style="flex-basis:40%"><!-- wp:group {"metadata":{"name":"Card"},"style":{"spacing":{"blockGap":"var:preset|spacing|small","padding":{"top":"var:preset|spacing|small","right":"var:preset|spacing|small","bottom":"var:preset|spacing|small","left":"var:preset|spacing|small"}},"border":{"radius":"5px"},"layout":{"selfStretch":"fixed","flexSize":"360px"}},"backgroundColor":"base","layout":{"type":"constrained"}} --> | |
<div class="wp-block-group has-base-background-color has-background" style="border-radius:5px;padding-top:var(--wp--preset--spacing--small);padding-right:var(--wp--preset--spacing--small);padding-bottom:var(--wp--preset--spacing--small);padding-left:var(--wp--preset--spacing--small)"><!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|small"}},"layout":{"type":"co |
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 // Ignore this first line when copying to your child theme's functions.php file. | |
/** | |
* Listen for alternate close | |
* | |
* A workaround to fix the alternate close methods not working on back-to-back popups. | |
* | |
*/ | |
function listen_for_alternate_close() { ?> | |
<script type="text/javascript"> |
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 // Ignore this first line when copying to your child theme's functions.php file. | |
function say_hello_sc() { | |
$u = wp_get_current_user(); | |
$display_name = $u->display_name ?: 'there'; | |
$roles = (array) $u->roles ?: ['not logged in']; | |
return '<p>Yo, <strong>' . $display_name . '</strong> (<em>' . $roles[0] . '</em>)' . '. Thanks for stopping by ;-)</p>'; | |
} | |
add_shortcode('say_hello', 'say_hello_sc'); | |
/** |
NewerOlder