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. | |
/** | |
* This is an example of how to launch a Popup Maker popup after time on site is more | |
* than 1 minute (regardless of how many pages visited). | |
* | |
* Run this action at 500 priority. | |
* | |
* Change the popupId value to your popup's ID https://wppopupmaker.com/docs/manage-features-or-options/find-the-popup-id/ | |
* |
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. | |
/** | |
* Close a popup on a window scroll event. | |
*/ | |
function close_popup_on_scroll() { ?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { | |
// Set up your constants. |
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. | |
/** Try using the ACF shortcode first. */ | |
/** Turn on the ACF shortcode as of ACF 6.3.0. | |
* https://www.advancedcustomfields.com/resources/shortcode/#enabling */ | |
add_action( 'acf/init', 'set_acf_settings' ); | |
function set_acf_settings() { | |
acf_update_setting( 'enable_shortcode', true ); | |
} |
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 |
NewerOlder