Skip to content

Instantly share code, notes, and snippets.

View Crocoblock's full-sized avatar

Crocoblock Crocoblock

View GitHub Profile
@Crocoblock
Crocoblock / add_google_tag_manager_to_jtc.php
Created April 7, 2023 07:35 — forked from LaxusCroco/add_google_tag_manager_to_jtc.php
Add Google Tag Manager to JetThemeCore
<?php
/**
* Add Google Tag Manager code for the <head> tag.
*/
function custom_add_gtm_code() {
?>
<!-- Add your GTM code snippet below this line -->
<?php
<?php
//OBSOLETE
//Use Query Results built-in macro instead
//add Get properties from query macro
add_filter( 'jet-engine/listings/macros-list', 'register_query_items_macro' );
function register_query_items_macro( $macros_list ) {
@Crocoblock
Crocoblock / custom_loader.css
Created November 21, 2022 16:56 — forked from dislokacia/custom_loader.css
Custom Loader for JSF
/*For Elementor Pro User - in Custom CSS tab*/
/*In the custom spinner container widget Custom CSS field */
selector {
display:none;
}
selector i {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
@Crocoblock
Crocoblock / text_after_upload.js
Last active June 22, 2024 20:37 — forked from dislokacia/text_after_upload.js
JetFormbuilder media field text after upload
<script>
document.addEventListener( 'DOMContentLoaded', function() {
const {
addAction,
} = window.JetPlugins.hooks;
const textChoose = 'Choose File';
const textUpload = 'File Uploaded';
@Crocoblock
Crocoblock / text_after_upload.js
Last active June 22, 2024 20:38 — forked from dislokacia/text_after_upload.js
JetFormbuilder media field text after upload
document.addEventListener( 'DOMContentLoaded', function() {
const {
addAction,
} = window.JetPlugins.hooks;
const textChoose = 'Choose File';
const textEmpty = 'No file has been chosen';
const textUpload = 'File Uploaded';
function getFileNames( fileList ) {
@Crocoblock
Crocoblock / image-comparison-accordion-widgets-images-loading-fix.php
Last active October 20, 2022 07:33 — forked from LesykJulia/image-comparison-accordion-widgets-images-loading-fix.php
Fix images loading when logged out in the Image Comparison and Accordion widgets
<?php
add_action( 'init', function(){
global $wp_scripts;
$script = $wp_scripts->query( 'imagesloaded', 'registered' );
if ( ! $script ) {
return;
@Crocoblock
Crocoblock / cursor-as-standard-link-on-hover.css
Last active September 26, 2023 14:36 — forked from LesykJulia/cursor-as-standard-link-on-hover.css
Changing mouse cursor as a standard link on a listing item hover
@Crocoblock
Crocoblock / jet-woo-builder-variation-swatches-in-archive-template.php
Created October 17, 2022 14:26 — forked from UraraReika/jet-woo-builder-variation-swatches-in-archive-template.php
Add variation swatches template inside archive template price widget
<?php
add_filter( 'jet-woo-builder/template-functions/product-price', 'get_wvs_pro_archive_variation_template', 999, 1 );
function get_wvs_pro_archive_variation_template( $html ) {
$wvs_archive_variation_template = wvs_pro_archive_variation_template();
$html .= $wvs_archive_variation_template;
return '<div class="price">' . $html . '</div>';
<?php
add_filter( 'jet-woo-builder/template-functions/product-add-to-cart-settings', 'wvs_pro_archive_variation_button_args', 999, 2 );
function wvs_pro_archive_variation_button_args( $args ) {
global $product;
$product = wc_get_product();
$ajax_add_to_cart_enabled = 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' );
<style>
.jet-filter-label:after {
content: "˅";
float: right;
margin-right: 10px;
}
.jet-filter-label.noicon:after{
content: "";