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 | |
/** | |
* Our theme/plugin enqueue scripts function. | |
*/ | |
function example_enqueue_scripts() { | |
// Register the script in the normal WordPress way. | |
wp_register_script( 'example-shortcode-js', '...example-shortcode-script.js' ); | |
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 | |
function understrap_get_custom_logo_attributes( $custom_logo_attr ){ | |
$custom_logo_attr['data-no-lazy'] = '1'; | |
$custom_logo_attr['loading'] = 'eager'; | |
return $custom_logo_attr; | |
} | |
add_filter( 'get_custom_logo_image_attributes', 'understrap_get_custom_logo_attributes' ); |
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
// Add your custom JS here. | |
import Popover from 'bootstrap/js/dist/popover' | |
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')) | |
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) { | |
return new Popover(popoverTriggerEl) |
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 | |
/** | |
* The template for displaying archive pages | |
* | |
* Learn more: http://codex.wordpress.org/Template_Hierarchy | |
* | |
* @package Understrap | |
*/ | |
// Exit if accessed directly. |
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 | |
/** | |
* Post rendering content according to caller of get_template_part | |
* | |
* @package Understrap | |
*/ | |
// Exit if accessed directly. | |
defined( 'ABSPATH' ) || exit; | |
?> |
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
{ | |
"JQuery Frame": { | |
"prefix": "wpjquery", | |
"body": [ | |
"(function($) {", | |
"", | |
"\t$(document).ready(function($){", | |
"", | |
"\t\t$1", | |
"", |
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($) { | |
$(document).ready(function($){ | |
}); | |
})( jQuery ); |
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 | |
// Put this in wp-config.php and replace https://example.com/ with the URL of the production site. | |
define( 'BC_USE_REMOTE_MEDIA_URL', 'https://example.com' ); | |
// Put the rest of this in functions.php or a custom plugin or somewhere else. | |
if ( defined( 'BC_USE_REMOTE_MEDIA_URL' ) && ! empty( BC_USE_REMOTE_MEDIA_URL ) ) { | |
add_filter( 'wp_get_attachment_image_src', 'bc_filter_wp_get_attachment_image_src' ); | |
add_filter( 'wp_calculate_image_srcset', 'bc_filter_wp_calculate_image_srcset' ); | |
add_filter( 'wp_get_attachment_url', 'bc_filter_wp_get_attachment_url' ); | |
} |
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 | |
/** | |
* Our custom alternative to wc_mail. | |
* | |
* @param mixed $to Receiver. | |
* @param mixed $subject Subject. | |
* @param mixed $message Message. | |
* @param string $headers Headers. (default: "Content-Type: text/html\r\n"). | |
* @param string $attachments Attachments. (default: ""). | |
* @return bool |