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 cmp($a, $b) { | |
$a = date('c', strtotime($a)); | |
$b = date('c', strtotime($b)); | |
$ay = date('Y', strtotime($a)); | |
$by = date('Y', strtotime($b)); | |
if ($a == $b) { | |
$r = 0; | |
} else { | |
if ($ay < $by) { |
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 show_current_template($wp_admin_bar) { | |
global $template; | |
$args = array( | |
'id' => 'current_template', | |
'title' => 'Current Template: '.basename($template), | |
'meta' => array('title'=>$template) | |
); | |
$wp_admin_bar->add_node($args); | |
} | |
if (current_user_can('manage_options') && !is_admin()) { add_action('admin_bar_menu', 'show_current_template', 9999); } |
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 is_page($pageid) { | |
if (jQuery('body').hasClass('page-id-'+$pageid)) { return true; } else { 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
function currentBreakpoint() { | |
var sm = 768; | |
var md = 992; | |
var lg = 1200; | |
var bp; | |
var win = window.innerWidth; | |
if (win < sm) { bp = 'xs'; } | |
if (win >= sm && win < md) { bp = 'sm'; } | |
if (win >= md && win < lg) { bp = 'md'; } | |
if (win >= lg) { bp = 'lg'; } |
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 add_mime_types($mime_types) { | |
$mime_types['qbb'] = 'application/octet-stream'; | |
return $mime_types; | |
} | |
add_filter('upload_mimes', 'add_mime_types', 1, 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
<\?(?!php)(?!xml)(?!=) |
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
jQuery('.fancybox').fancybox({ | |
beforeLoad: function(){ jQuery('#myCarousel').carousel('pause'); }, | |
beforeClose: function(){ jQuery('#myCarousel').carousel('cycle'); } | |
}); |
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 printImage(image, title) { | |
var winContent = "<html><head><title>" + title + "</title><script>function step1(){\n" + | |
"setTimeout('step2()', 10);}\n" + | |
"function step2(){window.print();window.close()}\n" + | |
"</scri" + "pt></head><body onload='step1()'>\n" + | |
"<img src='" + image + "' /></body></html>"; | |
var win = window.open('about:blank', '_new'); | |
win.document.open(); | |
win.document.write(winContent); |
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 has_term_descendant($parent_term, $taxonomy, $post_id = null) { | |
if (empty($post_id)) { $post_id = get_the_ID(); } | |
$terms = get_the_terms($post_id, $taxonomy); | |
if (!empty($terms)) { | |
foreach ($terms as $term) { | |
if (term_is_ancestor_of($parent_term, $term, $taxonomy)) { | |
return true; | |
} |
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 | |
ob_start(); | |
session_start(); | |
require_once('recaptchalib.php'); | |
$key_public = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; | |
$key_private = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; | |
$captchaFailed = false; |
OlderNewer