Skip to content

Instantly share code, notes, and snippets.

View muks999's full-sized avatar

Muks999 muks999

View GitHub Profile
@muks999
muks999 / gist:954b69d65b65853a6f683d0ad6e1edda
Last active December 11, 2018 15:31
Расстановка переносов в html тексте на русском языке
/*Вызывается, как и любой jquery плагин:
$(function() { $('.article-text').hyphenate(); })
http://vyachet.ru/blog/2014/08/14/hyphen-russian-html-text/ -ссылка на оригинал статьи
http://jsfiddle.net/swed/94crypw7/ -демонстрация работы плагина*/
$.fn.hyphenate = function() {
var all = "[абвгдеёжзийклмнопрстуфхцчшщъыьэюя]",
glas = "[аеёиоуыэю\я]",
@muks999
muks999 / parallelize.php
Created March 15, 2017 22:24 — forked from leowebguy/parallelize.php
Parallelize downloads across hostnames for WordPress. Useful to boost static resources load speed on websites. Recommended by GTmetrix, Pingdom, Google Speed Insights, and others.
<?php
/******
Parallelize downloads across hostnames for WordPress.
Useful to boost static resources load speed on websites.
Recommended by GTmetrix, Pingdom, Google Speed Insights, and others.
See full post > https://medium.com/p/32e9dc2fec0c
In order to work properly, all subdomains/hostnames MUST have the same structure/path. Ex:
http://mydomain.com/wp-content/uploads/2015/11/myimage.jpg
@muks999
muks999 / menu_no_link
Created April 1, 2017 08:28 — forked from artikus11/menu_no_link
Уборка циклических ссылок в меню
@muks999
muks999 / functions.php
Created January 6, 2018 17:31 — forked from SJ-James/functions.php
Clear Local Storage Button For Divi
<?php
function ClearLocalCacheButton() { ?>
// Create Button
<a href="#" onclick="ClearLocalCache()" class="et-pb-layout-buttons et-pb-layout-buttons-cache" title="Clear Cache">
<span>Clear Cache</span>
</a>
<script type="text/javascript">
// Move Button to Divi Tabs
jQuery(window).load(function(){
@muks999
muks999 / In your functions file
Created January 6, 2018 17:40 — forked from SJ-James/more-divi-social-icons.php
Divi social icons extension
<?php // << Remove opener if adding to functions.php
if ( ! function_exists( 'et_load_core_options' ) ) {
function et_load_core_options() {
global $shortname, $themename;
require_once get_template_directory() . esc_attr( "/options_{$shortname}.php" );
$newOptions = [];
foreach ($options as $i => $optionArray) {
@muks999
muks999 / limit-low-stock-woo.php
Created January 6, 2018 17:40 — forked from SJ-James/limit-low-stock-woo.php
Limit Quantity for low stock items
<?php
function limit_wc_stock() {
global $product;
if ( $product->stock ) {
if ( number_format($product->stock,0,'','') < 100 ) { // If stock is less than 100
/* Limit Quantity */
function limit_wc_stock_quantity_args( $args, $product ) {
$args['max_value'] = 10; // Max value
return $args;
}
@muks999
muks999 / facebook_warning.php
Created January 6, 2018 17:41 — forked from SJ-James/facebook_warning.php
Facebook Browser Warning | Divi
<?php
if ( !function_exists( 'fb_browser_warning' ) ) {
function fb_browser_warning() {
?>
<style>
.fb_browser_warning {
position: relative;
background: #3B5998;
padding: 20px 20px 20px 80px;
@muks999
muks999 / related-posts.php
Last active January 6, 2018 17:41 — forked from SJ-James/related-posts.php
Display related posts by category on single-post template...
@muks999
muks999 / auto-enable-divi-page-builder-cpt
Created January 6, 2018 17:42 — forked from SJ-James/auto-enable-divi-page-builder-cpt
Auto-enable Divi Page Builder on all public custom post types (WooCommerce, LearnPress etc)
<?php
// copy function into functions.php
function dpb_all_post_types( $post_types ) {
$args = array(
'public' => true,
'_builtin' => false
);
@muks999
muks999 / jquery.Plugin.js
Last active January 6, 2018 21:08
jQuery Plugin Start
(function($) {
$.fn.myParallax = function(){
return this.each(function() {
var ths = $(this);
ths
.css({
"min-height" : "400px",