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 | |
$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 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 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 loading = false; | |
$(window).scroll(function(){ | |
if((($(window).scrollTop()+$(window).height())+250)>=$(document).height()){ | |
if(loading == false){ | |
loading = true; | |
$('#loadingbar').css("display","block"); | |
$.get("load.php?start="+$('#loaded_max').val(), function(loaded){ | |
$('body').append(loaded); | |
$('#loaded_max').val(parseInt($('#loaded_max').val())+50); | |
$('#loadingbar').css("display","none"); |
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
$.preloadImages = function() { | |
for(var i = 0; i<arguments.length; i++) { | |
$("<img />").attr("src", arguments[i]); | |
} | |
} | |
$(document).ready(function() { | |
$.preloadImages("hoverimage1.jpg","hoverimage2.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
background: -webkit-gradient(linear,left top,left bottom,from(#ff0052),to(#8e2b88)); | |
-webkit-background-clip: text; | |
-webkit-text-fill-color: transparent; |
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
$(document).ready(function(){ | |
$("table tr:even").addClass('stripe'); | |
}); |
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() { | |
$.fn.sortList = function() { | |
var mylist = $(this); | |
var listitems = $('li', mylist).get(); | |
listitems.sort(function(a, b) { | |
var compA = $(a).text().toUpperCase(); | |
var compB = $(b).text().toUpperCase(); | |
return (compA < compB) ? -1 : 1; | |
}); | |
$.each(listitems, function(i, itm) { |
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 imgsrc = 'img/image1.png'; | |
$('<img/>').load(function () { | |
alert('image loaded'); | |
}).error(function () { | |
alert('error loading image'); | |
}).attr('src', imgsrc); |
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
$("#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 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
<input type="password" name="pass" id="pass" /> | |
<span id="passstrength"></span> |
NewerOlder