Skip to content

Instantly share code, notes, and snippets.

View muks999's full-sized avatar

Muks999 muks999

View GitHub Profile
@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 / functions.php
Created January 7, 2018 04:36 — forked from fldtrace/functions.php
Better, Faster, Responsive Images for Divi – Upload in Divi child theme.
<?php
// enable divi functions
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
//add 1440px image size
add_image_size('image_1440', 1440, 9999, false);
@muks999
muks999 / mvvm.html
Created June 14, 2018 05:41 — forked from smelukov/mvvm.html
Very simple MVVM (dynamic data binding) on JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>MVVM</h1>