View gist:55c990b1d5b517ccf043
1 2 3 4 5 6 7 8 9 10
// Get any existing copy of our transient data
if ( false === ( $%filltext:name=Query Name:default=myquery% = get_transient( '%filltext:name=Query Name:default=myquery%' ) ) ) {
// It wasn't there, so regenerate the data and save the transient
$%filltext:name=Query Name:default=myquery%_args = array(
'post_type' => '%filltext:name=Post Type:default=post%',
'order' => '%fillpopup:name=Order:default=ASC:DESC%',
'orderby' => '%fillpopup:name=Orderby:default=date:ID:rand:title:author:menu_order%',
'post_status' => 'publish',
'posts_per_page' => %filltext:name=Posts Per Page:default=-1%
View index.php
1 2 3 4 5 6 7 8 9 10
<?php global $wp_query;
query_posts(
array_merge(
$wp_query->query,
array(
'orderby' => 'post_date',
'order' => 'desc'
)
)
);
View functions.php
1 2 3 4 5 6 7 8
<?php
add_filter( 'tiny_mce_before_init', 'mb_unhide_kitchensink' );
function mb_unhide_kitchensink( $args ) {
$args['wordpress_adv_hidden'] = false;
return $args;
}
View taxonomy-query-loop.php
1 2 3 4 5 6 7 8 9 10
<?php
// Get terms
// http://codex.wordpress.org/Function_Reference/get_terms
// use $args array in second parameter if needed
$my_categories = get_terms( 'TERM_NAME_HERE' );
$my_categories_count = count( $my_categories );
if ( $my_categories_count > 0 && is_array( $my_categories ) ) {
echo '<div class="wrap">';
View wp-setup.sh
1 2 3 4 5 6 7 8 9 10
# Create directory for new site
cd ~/Sites
mkdir {query}
cd {query}
 
# Download latest version of WordPress
wp core download
 
# Setup wp-config file with WP_DEBUG enabled
wp core config --dbname={query} --dbuser=root --dbpass=root --dbprefix={query}wp_ --extra-php <<PHP
View gulpfile.js
1 2 3 4 5 6 7 8 9 10
// Load plugins
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')({ camelize: true }),
lr = require('tiny-lr'),
server = lr();
 
// Styles
gulp.task('styles', function() {
return gulp.src('assets/styles/source/*.scss')
.pipe(plugins.rubySass({ style: 'expanded', compass: true }))
View Vagrantfile
1 2 3 4 5 6 7 8 9 10
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
 
config.vm.network :private_network, ip: "192.168.204.72"
config.ssh.forward_agent = true
 
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 1024]
View Gruntfile.js
1 2 3 4 5 6 7 8 9 10
'use strict';
module.exports = function(grunt) {
 
// load all grunt tasks matching the `grunt-*` pattern
require('load-grunt-tasks')(grunt);
 
grunt.initConfig({
 
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
View Gruntfile.js
1 2 3 4 5 6 7 8 9 10
'use strict';
module.exports = function(grunt) {
 
// load all grunt tasks matching the `grunt-*` pattern
require('load-grunt-tasks')(grunt);
 
grunt.initConfig({
 
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
View mb_html5_doctype.php
1 2 3 4 5 6 7 8 9 10
/**
* HTML5 DOCTYPE
* removes the default Genesis doctype, adds new html5 doctype with IE8 detection
*/
function mb_html5_doctype() {
?>
<!DOCTYPE html>
<!--[if IE 8]> <html class="lt-ie9" <?php language_attributes( 'html' ); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html <?php language_attributes( 'html' ); ?>> <!--<![endif]-->
Something went wrong with that request. Please try again.