This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 ); |
This file contains hidden or 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
/** | |
* Popup content link | |
* | |
* Use this CSS if you don't want to change your theme's global | |
* link text color. | |
*/ | |
.pum-content a { | |
color: orange; /* Change this to the color you want. */ | |
} | |
/** |