Skip to content

Instantly share code, notes, and snippets.

View yao3060's full-sized avatar

YAOYINGYING yao3060

View GitHub Profile
@yao3060
yao3060 / gist:3650850
Created September 6, 2012 03:35
Wp PageNavi
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?>
<?php wp_pagenavi(); // Use PageNavi ?>
<?php } else { // Otherwise, use traditional Navigation ?>
<?php if ( get_next_posts_link() ) : ?>
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'glasses' ) ); ?></div>
<?php endif; ?>
@yao3060
yao3060 / gist:3650732
Created September 6, 2012 03:26
CSS snippets
/*opacity-hack*/
selector {
filter: alpha(opacity=60); /* MSIE/PC */
-moz-opacity: 0.6; /* Mozilla 1.6 and older */
opacity: 0.6;
}
/* clear float */
.clear {
@yao3060
yao3060 / gist:3650692
Created September 6, 2012 03:23
.htaccess force-www
# force www in url
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# END force www in url
Report
@yao3060
yao3060 / gist:3650568
Created September 6, 2012 03:13
Javascript Field Valid
function isEmail(str){
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
return reg.test(str);
}
function IsNumeric(input)
{
return (input - 0) == input && input.length > 0;
}