Skip to content

Instantly share code, notes, and snippets.

View ulziibat-n's full-sized avatar
💭
Everyday Hard Working ...

Ulziibat Nansaltsog ulziibat-n

💭
Everyday Hard Working ...
  • Mongolia
View GitHub Profile
@Drafteed
Drafteed / gist:595a337a87627123bd9e01691d86840b
Created May 28, 2019 16:20
Smooth Scrollbar SoftScroll Plugin
/*!
* SmoothScrollbar SoftScroll Plugin
*
* @version 1.0.2
* @author Artem Dordzhiev (Draft)
*/
import Scrollbar from "smooth-scrollbar";
class SoftScrollPlugin extends Scrollbar.ScrollbarPlugin {
@Sharifur
Sharifur / elementor-condition-example.php
Created May 22, 2019 04:42
elementor condition example, elementor multiple condition example
<?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
====================================*/
@nicomollet
nicomollet / woocommerce_structured_data_product_brand.php
Created May 1, 2019 08:41
WooCommerce: Adds Brand attribute to "Product" Structured Data
<?php
/**
* WooCommerce: Adds Brand attribute to "Product" Structured Data
*
* @param array $data
*
* @return array
*/
function woocommerce_structured_data_product_brand ($data) {
global $product;
@nicomollet
nicomollet / woocommerce-sales-empty-cache.php
Created December 7, 2018 08:22
WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket)
<?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' ) ) {
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
@rogerlos
rogerlos / Dynamic-SelectControl.js
Last active October 20, 2022 12:21
Allows Gutenberg SelectControl to have its options dynamically populated.
/*
* 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.)
*/
@BinaryMoon
BinaryMoon / get-post-gallery.php
Last active May 1, 2021 13:03
Make WordPress function Get_Post_Gallery work for Gutenberg powered sites.
<?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
@nicomollet
nicomollet / elementor-template-polylang-translation.php
Created September 17, 2018 12:44
Elementor get polylang translation of template
<?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' ) ) {
@josanua
josanua / theme-helper.php
Last active March 15, 2024 08:27
Theme Dev Helper
<?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/
@1naveengiri
1naveengiri / convertor.php
Last active January 13, 2019 10:22
Convert ACF Fields Registered by PHP to Importable JSON Format
<?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 = [];