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
/*! | |
* SmoothScrollbar SoftScroll Plugin | |
* | |
* @version 1.0.2 | |
* @author Artem Dordzhiev (Draft) | |
*/ | |
import Scrollbar from "smooth-scrollbar"; | |
class SoftScrollPlugin extends Scrollbar.ScrollbarPlugin { |
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 | |
class Elementor_Custom_Widget extends \Elementor\Widget_Base { | |
/*================================= | |
Single condition:- | |
====================================*/ | |
/*================================= | |
Credit: Eqbal Rony | |
original gist: https://github.com/iqbalrony/elementor-conditions/blob/master/conditions.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 | |
/** | |
* WooCommerce: Adds Brand attribute to "Product" Structured Data | |
* | |
* @param array $data | |
* | |
* @return array | |
*/ | |
function woocommerce_structured_data_product_brand ($data) { | |
global $product; |
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 | |
/** | |
* WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket) | |
* | |
* @since 1.0.9 | |
*/ | |
function woocommerce_scheduled_sales_empty_wprocket_cache(){ | |
// Clear WP Rocket Cache (whole site) | |
if ( function_exists( 'rocket_clean_domain' ) ) { |
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
Javascript libraries | |
Particles.js — A library for creating beautiful floating particles on a web page | |
Three.js — A library for creating 3d objects and spaces on a web page | |
Fullpage.js — Easy to implement full page scroll feature | |
Typed.js — Typewriter effect | |
Waypoints.js — Trigger a function when you scroll to an element |
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
/* | |
* This is an abbreviated "ES5" script (though it has some ES6 language, just not JSX, or dependencies on npm) | |
* demonstrating how to get the WordPress "Gutenberg" SelectControl to allow dynamic options. | |
* | |
* It probably isn't elegant, but neither am I...I included more context than may be necessary. | |
* | |
* (SelectControl pukes on dynamic options because it completely dies, never to be seen again, if it | |
* is sent an empty options array. This prevents that with a placeholder until your results come back.) | |
*/ |
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 | |
/** | |
* Plugin Name: Get Post Gallery Polyfill | |
* Plugin URI: https://prothemedesign.com | |
* Description: Make Get_Post_Gallery work for Gutenberg powered sites. | |
* Author: Ben Gillbanks | |
* Version: 1.0 | |
* Author URI: https://prothemedesign.com | |
* | |
* @package ptd |
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 | |
/** | |
* Elementor get polylang translation of template | |
*/ | |
add_filter( 'elementor/theme/get_location_templates/template_id', function( $post_id ) { | |
if(!is_admin()){ | |
if ( function_exists( 'pll_get_post' ) ) { |
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 | |
// General info | |
https://codex.wordpress.org/Theme_Development | |
// Core info | |
https://wp-learner.com/wotdpress-development/wordpress-core-files-and-functions/ | |
// Theme Handbook | |
https://developer.wordpress.org/themes/ |
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 | |
/** | |
* create a file acf-import.json inside your theme main folder | |
* use this code in themes functions.php or in any custom plugin. | |
* It is one time code so it will add all fields json entry inside acf-import.json file | |
*/ | |
add_action('init', 'create_fieldjson_from_fieldphp'); | |
function create_fieldjson_from_fieldphp() { | |
$groups = acf_get_local_field_groups(); | |
$json = []; |