Skip to content

Instantly share code, notes, and snippets.

@jaredatch
jaredatch / gist:3604502
Created September 2, 2012 21:02
Genesis HTml5 doctype
<?php
/**
* Set HTML5 doctype
*
* @since 1.0.0
*/
function ja_html5_doctype() {
?>
<!doctype html>
<html <?php language_attributes( 'html' ); ?>>
@jaredatch
jaredatch / gist:3604536
Created September 2, 2012 21:05
Prevent WordPress theme update prompt
<?php
/**
* Don't Update Theme
*
* If there is a theme in the repo with the same name,
* this prevents WP from prompting an update.
*
* @author Mark Jaquith
* @link http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/
* @since 1.0.0
@jaredatch
jaredatch / gist:3604563
Created September 2, 2012 21:08
Load javascript for theme
<?php
/**
* Global javascript. Enqueue it we will.
*
* @since 1.0.0
*/
function ja_global_js() {
// Remove scripts
wp_deregister_script( 'superfish-args' );
// Register Ssripts
@jaredatch
jaredatch / gist:3604586
Last active December 9, 2015 21:44
Load custom CSS on admin login page
<?php
/**
* Customize CSS for login screen
*
* @since 1.0.0
* @author Jared Atchison
* @link http://jaredatchison.com/code/
*/
function ja_login_screen_css() {
echo '<link rel="stylesheet" type="text/css" href="' . get_stylesheet_directory() . '/css/style-login.css" />' . "\n";
@jaredatch
jaredatch / gist:3604611
Created September 2, 2012 21:14
Set viewport for responsive design
<?php
/**
* Set viewport for responsiveness
*
* @since 1.0.0
*/
function ja_viewport(){
echo '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n";
}
add_action( 'wp_head', 'ja_viewport' );
@jaredatch
jaredatch / gist:3604626
Last active October 10, 2015 00:38
Dropdown menu walker class for mobile
<?php
/**
* Select dropdown menu walker class
*
* @since 1.0.0
* @link http://jaredatchison.com/code/
*/
class ja_Mobile_Menu_Walker extends Walker_Nav_Menu{
private $to_depth = -1;
@jaredatch
jaredatch / gist:3604634
Created September 2, 2012 21:18
Genesis blank full-width homepage template
<?php
/**
* This is the homepage template file.
*
* @package JaredAtchisonTheme
* @since 1.0.0
*/
// Remove default loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
@jaredatch
jaredatch / .gitignore
Created September 12, 2012 23:02
Base .gitignore
.svn*
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
.gitignore
Icon?
ehthumbs.db
Thumbs.db
@jaredatch
jaredatch / gist:3746275
Last active October 10, 2015 20:28
Add slug to body class
<?php
/**
* Add slug to body class
*
* @author Jared Atchison
* @link http://jaredatchison.com/code/
* @param array $classes
* @return array
*/
function ja_body_class_slug( $classes ){
@jaredatch
jaredatch / gist:3753208
Created September 20, 2012 00:25
.htaccess disallow git and svn access
# disallow access to git and svn directories
RedirectMatch 404 /\.(svn|git)(/|$)