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 ...
View GitHub Profile
<?php
function idesign_customizer_config() {
$url = get_stylesheet_directory_uri() . '/inc/kirki/';
/**
* If you need to include Kirki in your theme,
* then you may want to consider adding the translations here
@aristath
aristath / custom-post-type-plugin.php
Last active July 21, 2021 13:08
sample theme to test REST
<?php
/**
* Plugin Name: Code Meta fields.
*
* @package My Theme
*/
/**
* Register the post-type.
*/
@nicomollet
nicomollet / polylang-langswitcher-shortcode.php
Last active April 16, 2025 15:26
Polylang shortcode for lang switcher
<?php
/**
* Polylang Shortcode - https://wordpress.org/plugins/polylang/
* Add this code in your functions.php
* Put shortcode [polylang_langswitcher] to post/page for display flags
*
* @return string
*/
function custom_polylang_langswitcher() {
$output = '';
@igorbenic
igorbenic / block.js
Last active April 22, 2022 22:25
Gutenberg Select Post - Duplicate Controls
/**
* BLOCK: my-block
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
// Import CSS.
import './style.scss';
import './editor.scss';
@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 = [];
@josanua
josanua / theme-helper.php
Last active December 27, 2024 09:31
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/
@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' ) ) {
@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
@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.)
*/
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