Skip to content

Instantly share code, notes, and snippets.

View smonteverdi's full-sized avatar

Sean Monteverdi smonteverdi

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="assets/css/main.css" type="text/css" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@smonteverdi
smonteverdi / gist:1993724
Created March 7, 2012 15:13
HTML: HTML5 Starter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 Starter</title>
<link rel="stylesheet" href="assets/css/main.css" type="text/css" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@smonteverdi
smonteverdi / gist:1993823
Created March 7, 2012 15:33
WordPress: Display Recent Posts
<?php wp_get_archives('title_li=&type=postbypost&limit=10'); ?>
@smonteverdi
smonteverdi / gist:1993843
Created March 7, 2012 15:37
Link to Javascript in Admin
function plugin_admin_head_js() {
print "<script type='text/javascript' src='linktoyourjs.js'></script>";
}
add_action('admin_head', 'plugin_admin_head_js');
@smonteverdi
smonteverdi / gist:1993855
Created March 7, 2012 15:40
WordPress: Loop through custom post types
$args = array( 'post_type' => 'product', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
echo '<div class="entry-content">';
the_content();
echo '</div>';
endwhile;
@smonteverdi
smonteverdi / gist:1993860
Created March 7, 2012 15:41
WordPress: Menu wrapped in nav
<?php wp_nav_menu( array( 'container' => 'nav','container_id' => 'side-menu', 'container_class' => '') ); ?>
@smonteverdi
smonteverdi / gist:1993865
Created March 7, 2012 15:41
WordPress: Security mods
// Security checks
function wrong_login() {
return 'Wrong username or password.';
}
add_filter('login_errors', 'wrong_login');
function remove_version() {
return '';
}
add_filter('the_generator', 'remove_version');
@smonteverdi
smonteverdi / gist:1993869
Created March 7, 2012 15:42
WordPress: Show custom field outside of loop
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'MyField', true);
?>
@smonteverdi
smonteverdi / gist:1993873
Created March 7, 2012 15:43
CSS: Hide Text
.hide-text { text-indent: 100%; white-space: nowrap; overflow: hidden; font:0/0; text-shadow: none; }
@smonteverdi
smonteverdi / gist:1993884
Created March 7, 2012 15:46
CSS: Inset Box
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) inset, 0 1px 0 rgba(255, 255, 255, .1);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) inset, 0 1px 0 rgba(255, 255, 255, .1);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) inset, 0 1px 0 rgba(255, 255, 255, .1);