View archive.php
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 | |
*/ |
View wrapImagesWithLink.js
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'); |
View custom_url_contains_condition.php
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 word "test" in it. | |
* | |
* Usage: | |
* 1) Install the Popup Maker Advanced Targeting Conditions extension. | |
* 2) Edit a popup. | |
* 3) Go to Popup Settings > Targeting. |
View force_focus_on_name_field.php
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 ($) { |
View disable-popup-maker-woocommerce-archive-page.php
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 ); |
View popup-maker-content-link-color-override.css
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
/** | |
* 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. */ | |
} | |
/** |
View send_video_link_to_popup.php
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. | |
/** | |
* Based on https://youtu.be/zml-xz78o2Q | |
*/ | |
function send_video_link_to_popup() { ?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { | |
const popupID = 2114, // Change to your popup IDs. | |
defVid = '2E1Pw39TtFM'; // We need to use the original video ID in the popup as a placeholder. |
NewerOlder