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. */ | |
| } | |
| /** |
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. | |
| /** | |
| * Send a video link to a popup using a URL in a data attribute. | |
| */ | |
| function send_video_link_to_popup() | |
| { ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function($) { | |
| const popupID = 85, // Change to your popup IDs. |