This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( !function_exists( 'fb_browser_warning' ) ) { | |
function fb_browser_warning() { | |
?> | |
<style> | |
.fb_browser_warning { | |
position: relative; | |
background: #3B5998; | |
padding: 20px 20px 20px 80px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// copy function into functions.php | |
function dpb_all_post_types( $post_types ) { | |
$args = array( | |
'public' => true, | |
'_builtin' => false | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
OlderNewer