Skip to content

Instantly share code, notes, and snippets.

View Woorg's full-sized avatar

Igor Gorlov Woorg

View GitHub Profile
@Woorg
Woorg / example-menu-item.css
Created January 22, 2025 22:04 — forked from isotrope/example-menu-item.css
Add (a) Polylang switcher menu item(s) to any menu.
/*
Example CSS of how I was showing one OR the other, based on brwoser-width
*/
@media (max-width: @grid-float-breakpoint-max) {
.language-code {
display: none;
}
}
@Woorg
Woorg / Commands
Created June 15, 2024 22:07 — forked from lukecav/Commands
Delete all draft posts, posts in trash and post revisions using WP-CLI
# delete all posts in trash, draft posts and post revisions
wp post delete $(wp post list --post_status=trash --format=ids)
wp post delete $(wp post list --post_status=draft --format=ids)
wp post delete $(wp post list --post_type='revision' --format=ids)
@Woorg
Woorg / nvmCommands.js
Created December 1, 2023 18:12 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@Woorg
Woorg / README.md
Created July 23, 2023 14:56 — forked from nivethan-me/README.md
Setup a Next.js 13 project with Eslint + Prettier with automatic tailwind class sorting
@Woorg
Woorg / wp-config.php
Created February 22, 2021 03:22 — forked from arkadiusjonczek/wp-config.php
WordPress: Use wp-cli & laradock/docker together #tags: WordPress
/** MySQL hostname */
if (php_sapi_name() == 'cli') {
define( 'DB_HOST', '127.0.0.1' );
}
else {
define( 'DB_HOST', 'mysql' );
}
@Woorg
Woorg / get-vw.sass
Created January 23, 2021 06:30
SASS function to convert px unit in vw
$vw-viewport: 320
$vw-enable: true
@function get-vw($font)
@if $vw-enable
$vw-context: $vw-viewport * 0.01 * 1px
@return $font / $vw-context * 1vw
@return $font
@Woorg
Woorg / .lando.yml
Created September 23, 2020 11:54 — forked from lumpysimon/.lando.yml
Lando config file for WordPress with Nginx, PHP 7.2, MySQL 5.5, Xdebug, MailHog and PHPMyAdmin
name: mysite2
recipe: wordpress
config:
php: '7.2'
via: nginx
webroot: public
xdebug: true
conf:
php: .vscode/php.ini
proxy:
@Woorg
Woorg / functions.php
Created January 16, 2020 01:02 — forked from alexander-young/functions.php
Defer Javascript in WordPress
function defer_parsing_of_js($url)
{
if (is_admin()) return $url; //don't break WP Admin
if (false === strpos($url, '.js')) return $url;
if (strpos($url, 'jquery.js')) return $url;
return str_replace(' src', ' defer src', $url);
}
add_filter('script_loader_tag', 'defer_parsing_of_js', 10);
@Woorg
Woorg / wp_bem_menu.php
Created January 14, 2020 17:40 — forked from AlexanderChev/wp_bem_menu.php
wordpress BEM menu
<?php
/**
* Walker Texas Ranger
* Inserts some BEM naming sensibility into Wordpress menus
*/
class walker_texas_ranger extends Walker_Nav_Menu {
function __construct($css_class_prefix) {
$this->css_class_prefix = $css_class_prefix;
// Define menu item names appropriately
<?php
/**
* Template Name: Testimonials - Native Functions
*/
add_action( 'genesis_entry_content', 'prefix_output_testimonials' );
/**
* Output ACF testimonials.
*
* @link https://acfextras.com/simple-testimonials-repeater-field/