This file contains hidden or 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 hidden or 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
$(document).ready(function(){ | |
$("table tr:even").addClass('stripe'); | |
}); |
This file contains hidden or 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
$("#content").load("somefile.html", function(response, status, xhr) { | |
// error handling | |
if(status == "error") { | |
$("#content").html("An error occured: " + xhr.status + " " + xhr.statusText); | |
} | |
}); |
This file contains hidden or 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 hidden or 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 hidden or 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 getWorkingDays($startDate,$endDate,$holidays) { | |
// do strtotime calculations just once | |
$endDate = strtotime($endDate); | |
$startDate = strtotime($startDate); | |
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24 | |
//We add one to inlude both dates in the interval. | |
$days = ($endDate - $startDate) / 86400 + 1; |
This file contains hidden or 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 hidden or 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 | |
$attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image') ); | |
if ( $attachments ) { | |
// do conditional stuff here | |
} |
This file contains hidden or 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
background: -webkit-gradient(linear,left top,left bottom,from(#ff0052),to(#8e2b88)); | |
-webkit-background-clip: text; | |
-webkit-text-fill-color: transparent; |
This file contains hidden or 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); |