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
$(window).bind("load", function() { | |
// IMAGE RESIZE | |
$('#product_cat_list img').each(function() { | |
var maxWidth = 120; | |
var maxHeight = 120; | |
var ratio = 0; | |
var width = $(this).width(); | |
var height = $(this).height(); | |
if(width > maxWidth){ |
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
var $tfoot = $('<tfoot></tfoot>'); | |
$($('thead').clone(true, true).children().get().reverse()).each(function(){ | |
$tfoot.append($(this)); | |
}); | |
$tfoot.insertAfter('table thead'); |
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
// global vars | |
var winWidth = $(window).width(); | |
var winHeight = $(window).height(); | |
// set initial div height / width | |
$('div').css({ | |
'width': winWidth, | |
'height': winHeight, | |
}); |
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
$('a').each(function() { | |
var a = new RegExp('/' + window.location.host + '/'); | |
if(!a.test(this.href)) { | |
$(this).click(function(event) { | |
event.preventDefault(); | |
event.stopPropagation(); | |
window.open(this.href, '_blank'); | |
}); | |
} | |
}); |
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
setInterval(function() { | |
$("#refresh").load(location.href+" #refresh>*",""); | |
}, 10000); // milliseconds to wait |
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
$("a[href='#top']").click(function() { | |
$("html, body").animate({ scrollTop: 0 }, "slow"); | |
return 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
<!--[if mso]> | |
<center> | |
<table><tr><td width="580"> | |
<![endif]--> | |
<div style="max-width:580px; margin:0 auto;"> | |
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p> | |
</div> | |
<!--[if mso]> |
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 authorNotification( $new_status, $old_status, $post ) { | |
if ( $new_status == 'publish' && $old_status != 'publish' ) { | |
$author = get_userdata($post->post_author); | |
$message = " | |
Hi ".$author->display_name.", | |
New post, ".$post->post_title." has just been published at ".get_permalink( $post->ID ).". | |
"; | |
wp_mail($author->user_email, "New Post Published", $message); |
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
<!-- ADD THIS TO XHTML --> | |
<div id="preloaded-images"> | |
<img src="http://perishablepress.com/image-01.png" width="1" height="1" alt="Image 01" /> | |
<img src="http://perishablepress.com/image-02.png" width="1" height="1" alt="Image 02" /> | |
<img src="http://perishablepress.com/image-03.png" width="1" height="1" alt="Image 03" /> | |
</div> |
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
@media (-webkit-min-device-pixel-ratio: 2), | |
(min-resolution: 192dpi) { | |
.box{ | |
background:url('images/box-bg@2x.png') no-repeat top left; | |
background-size: 200px 200px; | |
} | |
} |