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
function setSameHeight(array){ | |
var list = '', | |
max = '', | |
children = []; | |
for (i = 0; i < array.length; i++) { | |
doMagic(array[i]) | |
} | |
function doMagic(string) { |
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
function vCenter() { | |
var def = '.vcenter', | |
target = '', | |
targetHeight = '', | |
marg = '', | |
parentHeight = ''; | |
var target = document.querySelectorAll(def); | |
for (var i = 0; i < target.length; i++) { | |
parentHeight = parseInt( |
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 | |
add_filter('wp_nav_menu_objects' , 'my_menu_class'); | |
function my_menu_class($menu) { | |
$level = 0; | |
$stack = array('0'); | |
foreach($menu as $key => $item) { | |
while($item->menu_item_parent != array_pop($stack)) { | |
$level--; | |
} | |
$level++; |
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
//DEEPNESS OF SCROLL | |
document.addEventListener("DOMContentLoaded", function(event) { | |
//DEEPNESS OF SCROLL | |
var switcher = [], | |
maxScroll = 0, | |
result = 0, | |
currentScroll = 0, | |
scrollPosition = 0; | |
var getPosition = 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
// Hack Contact Form 7 to avoid unwanted ajax calls | |
// see http://stackoverflow.com/questions/19632244/is-w3-total-cache-compatible-with-contact-form-7 | |
add_action('wpcf7_enqueue_scripts', 'hack_cf7'); | |
function hack_cf7() { | |
$_wpcf7 = array( | |
'loaderUrl' => wpcf7_ajax_loader(), | |
'sending' => __( 'Sending ...', 'contact-form-7' ) | |
); | |
wp_localize_script( 'contact-form-7', '_wpcf7', $_wpcf7 ); | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<modification> | |
<code>00001</code> | |
<name>Modification</name> | |
<version>1.0</version> | |
<author>Author Name</author> | |
<link>http://www.author.com</link> | |
<file path="catalog/controller/common/home.php"> | |
<operation> | |
<search><![CDATA[ |
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 html5_insert_image($html, $id, $caption, $title, $align, $url) { | |
$html5 = "<figure id='post-$id media-$id' class='align-$align'>"; | |
$html5 .= "<img src='' data-src='$url' alt='$title' />"; | |
if ($caption) { | |
$html5 .= "<figcaption>$caption</figcaption>"; | |
} | |
$html5 .= "</figure>"; | |
return $html5; | |
} |
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 | |
/* | |
Use this just like `add_filter()`, and then run something that calls the filter (like | |
`new WP_Query`, maybe). | |
That's it. If the filter gets called again, your callback will not be. | |
This works around the common "filter sandwich" pattern where you have to remember to | |
call `remove_filter` again after your call. |
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 | |
// HTTP | |
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . '/admin/'); | |
define('HTTP_CATALOG', 'http://' . $_SERVER['HTTP_HOST'] . '/'); | |
// HTTPS | |
define('HTTPS_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . '/admin/'); | |
define('HTTPS_CATALOG', 'http://' . $_SERVER['HTTP_HOST'] . '/'); |
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
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); |
OlderNewer