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
@MatthieuScarset
MatthieuScarset / .lando.yml
Created December 13, 2020 20:23
Lando (+3.0) with XDebug (WordPress recipe)
name: wordpress
recipe: wordpress
services:
appserver:
webroot: .
xdebug: debug
config:
php: .vscode/php.ini
tooling:
install:wordpress:
@PJoy
PJoy / guide.md
Last active June 17, 2023 04:50
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 / 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 / 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 ) {
// add_filter('show_admin_bar','codingeek_show_admin_bar');
function codingeek_check_user_validation(){
$current_user = wp_get_current_user();
if ( in_array('subscriber', $current_user)) {
//have to write code for subscriber
show_admin_bar( false ); // for hide adminbar
};
// add_filter('show_admin_bar','codingeek_show_admin_bar');
function codingeek_check_user_validation(){
$current_user = wp_get_current_user();
if ( in_array('subscriber', $current_user)) {
//have to write code for subscriber
show_admin_bar( false ); // for hide adminbar
};
@nicomollet
nicomollet / wpseo-schema-webpage.php
Last active June 9, 2023 12:51
Yoast Schema: Remove datePublished on WebPage
<?php
/**
* Yoast Schema: Remove datePublished on WebPage
*
* @param array $schema
*
* @return mixed
*/
function custom_wpseo_schema_webpage( $schema ) {
@nicomollet
nicomollet / wpseo_schema_organization.php
Last active June 9, 2023 12:51
Yoast SEO Organization Schema Replaced By LocalBusiness
<?php
/**
* Add LocalBusiness to schema Organization
*
* @api array $data The graph piece to filter.
*
* @return array
*/
function custom_wpseo_schema_organization($data){