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. | |
/** | |
* According to Gravity Forms Support on 9 March 2023, "The views column records the number of times the | |
* form markup is generated ... including when the form is redisplayed following validation errors. | |
* It's not strictly how many times the form was actually viewed." | |
* | |
* That means the Gravity Forms form view counter gets bumped up even if the form is hidden in a tab, popup, slider, and | |
* accordion (to name a few). Bottom line: don't trust the form view counter as a valid impression stat. | |
*/ |
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
const popupID = prompt("What's the popup ID number?"); | |
if (typeof PUM !== 'undefined') { | |
let triggers = PUM.getSettings(popupID).triggers[0]; | |
if (typeof triggers !== 'undefined') { | |
console.log(`%cTrigger Settings for Popup ID ${popupID}`, | |
"color: #b92099; font-size: 20px;"); | |
console.table(triggers); // Triggers | |
if (typeof triggers.settings !== 'undefined') { | |
console.table(triggers.settings); // Cookies | |
//console.table(PUM.getSettings(input).triggers[0][1].settings); // Displays cookie name` |
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 | |
/** | |
* Override the theme template for displaying archive pages. | |
* | |
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/ | |
* | |
* @package WordPress | |
* @subpackage Twenty_Twenty_One | |
* @since Twenty Twenty-One 1.0 | |
*/ |
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 () { | |
const images = document.querySelectorAll('img'); | |
const label = 'Images wrapped in an a tag.' | |
console.group(label); | |
images.forEach(function(elm) { | |
console.info('Wrapping this image: ', elm); | |
const wrapper = document.createElement('a'); |
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 PHP function will load a popup on a post or page only if the URL | |
* contains the string "yourstringgoeshere" in it. | |
* | |
* Usage: | |
* 1) Install the code snippet below. Make sure you change "yourstringgoeshere" to the string that'll | |
* be in your URL that you want to launch the popup. Example: https://twenty-twentyone.test/yourstringgoeshere/ | |
* 2) Install the Popup Maker Advanced Targeting Conditions extension. |
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. | |
<style> | |
/** For testing only. Remove for production. */ | |
:focus { | |
outline: 3px solid hotpink !important; | |
} | |
</style> | |
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { |
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. | |
add_action( 'wp', function() { | |
if ( is_product_category() ) { // echo '<h4>This is an archive page.</h4>'; | |
add_filter ( 'pum_popup_is_loadable', function( $is_loadable ) { | |
$is_loadable = false; | |
return $is_loadable; | |
} ); | |
} | |
}, 9 ); |