Skip to content

Instantly share code, notes, and snippets.

# ----------------------------------------------------------------------
# Gzip compression
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
@dlh01
dlh01 / wp-register-enqueue-assets.php
Created April 6, 2012 16:59
Template for registering and enqueueing scripts and styles in WordPress
<?php
/**
*
* Register and enqueue assets
*
*/
add_action( 'wp_enqueue_scripts', 'function_name_here' );
function function_name_here() {
@dlh01
dlh01 / install.php
Created April 27, 2012 23:39
Install WordPress without "Hello world!" and other default content
<?php
/**
*
* Install WordPress without "Hello world!" and other default content
*
* This function overrides the standard wp_install_defaults() in
* wp-admin/includes/upgrade.php. Leaving the function empty causes WordPress
* to install without the default post, page, links, categories, etc.
*
* Save this file as install.php inside your wp-content directory before beginning installation
@dlh01
dlh01 / gist:3922398
Created October 20, 2012 06:43
SASS mixin for Bootstrap breakpoints
/**
* Bootstrap breakpoints. Thanks goes to Chris Coyier for the inspiration.
*
* Original post and usage example: http://css-tricks.com/custom-user-mixins/
*/
@mixin breakpoint($point) {
@if $point == large-display {
@media (min-width: 1200px) { @content; }
}
@if $point == default {
@dlh01
dlh01 / gist:4217650
Created December 5, 2012 17:23
RNS issues
  • Real navigation links need to be added
  • Real logo and header treatment needs to be added
  • Ads break out of the container at tablet-ish viewport size
  • Activate sharing bars on posts
  • Style next/previous post links
  • Hook up real Press Releases feed
  • Media sizes not quite right yet
  • "From Our Blogs" content block missing on home page
  • Cookies for Comments image creates extra white space at bottom of site
@dlh01
dlh01 / gist:4481138
Last active December 10, 2015 19:28
<section class="cabinet">
<div class="cabinet-large">
<div class="media media-heading-medium">
<?php // The second post in the Headlines zone ?>
<?php $zone_query->the_post(); ?>
<?php [post stuff] ?>
</div><!--/.media-->
<?php
/**
@dlh01
dlh01 / config-snip.rb
Created March 28, 2013 20:21
sass config lines for use with source maps
# Enable these for source maps
# output_style = :compact
# sass_options = { :debug_info => true }
@dlh01
dlh01 / Jetpack Twitter widget template tag example.php
Created April 22, 2013 18:54
For using the Jetpack Twitter widget in a template, as of Jetpack 2.2.2
the_widget( 'Jetpack_Widget_Twitter',
array(
'title' => 'RNS on Twitter',
'account' => 'RNS',
'show' => 3,
'hidereplies' => true,
'hidepublicized' => true,
'includeretweets' => true,
'followbutton' => true
),
(min-width: 45rem) {
html {
font-size: 75% or 125% etc.
}
}
// via http://nataliemac.com/slides/type/
@dlh01
dlh01 / WordPress parent and child themes with Sass, Compass, and Grunt.md
Last active March 17, 2023 11:57
Maintaining stylesheets for WordPress parent and child themes using Sass, Compass, and Grunt

This post outlines a way to use Sass, Compass, and Grunt to maintain stylesheets for a WordPress parent and child theme.

Sass is useful for many reasons, but for our purposes, the two most helpful features are partials and variables. We'll also take advantage of the importPath setting of Compass and Grunt.

Comments and improvements are always welcome.

Step 1: Create your parent stylesheet

Create a new Compass project in your theme and style away. When you're finished, your theme directory (called parent here) might look something like this: