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
<?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
@ulziibat-n
ulziibat-n / font-stacks.css
Created December 15, 2020 18:37
Modern font stacks.
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* A modern Georgia-based serif */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@ulziibat-n
ulziibat-n / guide.md
Created March 19, 2020 12:58 — forked from PJoy/guide.md
SAGE BARBA

Using barba.js with Sage starter theme

Barba.js is a library using pushState and AJAX allowing websites to load pages asynchronously while still maintaining browser states and history.

Combining it with some JavaScript animations libraries can help craft some memorable browsing experiences.

alt text source

In this guide, we will try to find an optimal way to integrate Barba with our beloved Sage theme !

@ulziibat-n
ulziibat-n / elementor-category-posts-per-page.php
Created September 10, 2019 14:16 — forked from nicomollet/elementor-category-posts-per-page.php
Elementor: Force posts per page number for posts widget on Category Pages
<?php
/**
* Elementor: Force posts per page number for posts widget on Category Pages
*
* @param $query
*/
function elementor_category_posts_per_page( $query ) {
$category_id_or_slug = 'myslug';
@ulziibat-n
ulziibat-n / elementorcssinhead.php
Created September 10, 2019 14:15 — forked from nicomollet/elementorcssinhead.php
Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
<?php
/**
* Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
*/
function elementor_css_in_head(){
if(class_exists('\Elementor\Plugin')){
$elementor = \Elementor\Plugin::instance();
$elementor->frontend->enqueue_styles();
}
if(class_exists('\ElementorPro\Plugin')){
@ulziibat-n
ulziibat-n / polylang-langswitcher-shortcode.php
Created September 10, 2019 14:15 — forked from nicomollet/polylang-langswitcher-shortcode.php
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 = '';
@ulziibat-n
ulziibat-n / elementor-template-polylang-translation.php
Created September 10, 2019 14:15 — forked from nicomollet/elementor-template-polylang-translation.php
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' ) ) {
@ulziibat-n
ulziibat-n / woocommerce-sales-empty-cache.php
Created September 10, 2019 14:14 — forked from nicomollet/woocommerce-sales-empty-cache.php
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' ) ) {
@ulziibat-n
ulziibat-n / woocommerce_structured_data_product_brand.php
Created September 10, 2019 14:14 — forked from nicomollet/woocommerce_structured_data_product_brand.php
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;
@ulziibat-n
ulziibat-n / polylang-elementor-conditions-compatibility.php
Created September 10, 2019 14:12 — forked from nicomollet/polylang-elementor-conditions-compatibility.php
Fix for Elementor template conditions not compatible with polylang (you need to save again one of your templates to make it work, after putting this function in your plugin/theme). Needs to be priority 1
<?php
/**
* Fix for Elementor template conditions not compatible with Polylang (you need to save again one of your templates to make it work, after putting this function in your plugin/theme)
* Needs to be priority 1, since Polylang uses the action parse_query which is fired before pre_get_posts
*
* @link https://github.com/polylang/polylang/issues/152#issuecomment-320602328
*
* @param WP_Query $query
*/
function polylang_elementor_library_conditions_parse_query( $query ) {