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
<script> | |
function startScrolling(){ | |
var getInt = setInterval(function js_spinner(){ | |
if(typeof js_spinner_bottom === 'undefined'){ | |
js_spinner_bottom = 0; | |
} | |
js_spinner_bottom += 300; | |
if(js_spinner_bottom > 1200){ | |
js_spinner_bottom = 0; |
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
// Bind the mouse enter and mouse leave events using | |
// the convenience method, hover(). | |
$( "#outer-hover" ).hover( | |
function(){ | |
console.log( "mouseEnter" ); | |
}, | |
function(){ | |
console.log( "mouseLeave" ); | |
} | |
); |
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 wp_nav_menu( array('menu' => 'Top Bar', 'container' => '','container_class' => 'menu-{menu slug}-container navi','items_wrap' => '%3$s', 'fallback_cb' => 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
<?php wp_nav_menu( array('menu' => 'Top Bar', 'container' => '','container_class' => 'menu-{menu slug}-container navi','items_wrap' => '%3$s', 'fallback_cb' => 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
<?php wp_nav_menu( | |
array('menu' => 'Top Bar', 'container' => '','container_class' => 'menu-{menu slug}-container navi','items_wrap' => '%3$s', 'fallback_cb' => 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
// 60 seconds * 60 minutes * 24 hours = 1 day refresh | |
$refreshInterval = 60*60*24; | |
$input = range(1,30); | |
$arr = array_rand($input, 4); | |
if ( false === ( $featured_products = get_transient( 'featured_products' ) ) ) { | |
// It wasn't there, so regenerate the data and save the transient | |
$request_url = 'http://makershed.com/net/webservice.aspx?api_name=generic\featured_products'; |
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 js_featured_products() { | |
$input = range(1,30); | |
$arr = array_rand($input, 4); | |
// for debugging | |
// delete_transient( 'xml_featured_products' ); | |
if ( false === ( $xml_featured_products = get_transient( 'xml_featured_products' ) ) ) { | |
// It wasn't there, so regenerate the data and save the transient |
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 | |
date_default_timezone_set('America/Los_Angeles'); | |
$current_time = date('G:i'); | |
$start_time = '08:00'; | |
$end_time = '20:00'; | |
if( $current_time >= $start_time && $current_time <= $end_time ) | |
echo 'SOPA'; | |
else | |
echo 'not SOPA' |
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 | |
/* | |
* Plugin Name: Sopa Redirection | |
* Plugin URI: http://oreilly.com/blackout.html | |
* Description: Redirect the blog to oreilly blackout page. | |
* Author: whyisjake, tmoskowite | |
* Version: 1.0 | |
* Author URI: oreilly.com | |
*/ |
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 __update_post_meta( $post_id, $field_name, $value = '' ) { | |
if ( empty( $value ) OR ! $value ) { | |
delete_post_meta( $post_id, $field_name ); | |
} elseif ( ! get_post_meta( $post_id, $field_name ) ) { | |
add_post_meta( $post_id, $field_name, $value ); | |
} else { | |
update_post_meta( $post_id, $field_name, $value ); | |
} |
OlderNewer