Skip to content

Instantly share code, notes, and snippets.

@dlh01
dlh01 / trac.md
Last active December 20, 2015 11:29
notes about trac from WCSF 13 contributor day
  • report 16 (needs patch) are tickets looking for help
  • svn diff > [ticket number].diff
    • e.g. 23456.diff
  • cp ~/path/to/downloaded/patch.diff ./trunk/
    • patch -p0 < file.diff
  • how do you know where to start?
    • find a ticket in a section of WP you want to work in.
  • patience.
    • get in IRC
@dlh01
dlh01 / wp-sane-ctags.sh
Created June 14, 2013 00:48
generate a tags file that isn't 12 GB
ctags -R --languages=php,javascript --exclude=node_modules
@dlh01
dlh01 / Gruntfile.js
Last active December 18, 2015 11:29 — forked from anonymous/Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
// [other stuff...]
compass: {
options: {
sassDir: 'sass',
javascriptsDir: 'javascripts',
@dlh01
dlh01 / wp-zoninator-main-query.php
Created June 10, 2013 06:13
religionnews.com uses the Zoninator plugin to control our front page story hierarchy. This function collects our 'Headlines' zone as part of the main front page query, rather than ignoring the main query and starting a new one.
add_action( 'pre_get_posts', 'rns_get_headlines_zone', 10 );
/**
* Get the posts in the 'Headlines' zone in the front page main query
*
* @param obj $query The query to pass to the database
* @see Zoninator's get_zone_query()
*/
function rns_get_headlines_zone( $query ) {
if ( ! is_admin() && $query->is_main_query() && $query->is_home() ) {
global $zoninator;
@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:

(min-width: 45rem) {
html {
font-size: 75% or 125% etc.
}
}
// via http://nataliemac.com/slides/type/
@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
),
@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 / 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 / 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