Skip to content

Instantly share code, notes, and snippets.

View jonbellah's full-sized avatar

Jon Bellah jonbellah

View GitHub Profile
@jonbellah
jonbellah / gist:6140275
Created August 2, 2013 14:28
Deregister jQuery with wp_deregister_script
function theme_deregister_scripts() {
wp_deregister_script( 'jquery' );
}
add_action( 'wp_enqueue_scripts', 'theme_deregister_scripts' );
@jonbellah
jonbellah / gist:6139576
Last active December 20, 2015 13:29
Set a fallback for jQuery
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>if (!window.jQuery) {document.write('<script src="/wp-includes/js/jquery/jquery.js"><\/script>');}</script>
@jonbellah
jonbellah / gist:6100225
Created July 28, 2013 21:02
Login page logo
/** Change login logo. */
function cssforge_login_logo() { ?>
<style type="text/css">
body.login div#login h1 a {
background-image: url(<?php echo get_bloginfo( 'template_directory' ) ?>/images/login-logo.png);
padding-bottom: 10px;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'cssforge_login_logo' );
@jonbellah
jonbellah / functions.php
Last active December 19, 2015 21:49
Add Body Class in WordPress
function add_about_body_class( $classes ) {
if( is_page('about') )
$classes[] = 'about';
return $classes;
}
add_filter( 'body_class', 'add_about_body_class' );
@jonbellah
jonbellah / gist:5995781
Created July 14, 2013 20:17
Register Sidebar
function sidebar_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'theme' ),
'id' => 'sidebar-1',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
}
@jonbellah
jonbellah / gist:5984894
Created July 12, 2013 14:29
Running Compass
$ cd /path/to/your_project
$ compass watch
@jonbellah
jonbellah / gist:5984706
Created July 12, 2013 14:05
Minify CSS with Compass
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
# You can select your preferred output style here (can be overridden via the command line):
@jonbellah
jonbellah / gist:5984392
Created July 12, 2013 13:16
Compass Create
$ compass create path/to/your_project
@jonbellah
jonbellah / gist:5984320
Created July 12, 2013 13:06
Minify with Sass
$ sass --watch style.scss:style.css --style compressed
@jonbellah
jonbellah / style.css
Created July 8, 2013 11:46
Mobile Navigation Menu: The CSS
.dropdown {
position: absolute;
z-index: 9999999;
display: none;
}
.dropdown .dropdown-menu,
.dropdown .dropdown-panel {
list-style: none;
background: #FFF;