Skip to content

Instantly share code, notes, and snippets.

View butlerblog's full-sized avatar

Chad Butler butlerblog

View GitHub Profile
@butlerblog
butlerblog / woocommerce-settings-tab-demo.php
Last active March 29, 2024 09:15 — forked from BFTrick/woocommerce-settings-tab-demo.php
A plugin demonstrating how to add a #WooCommerce settings tab.
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@butlerblog
butlerblog / custom-queries.php
Created November 22, 2018 14:13 — forked from carlodaniele/custom-queries.php
An example plugin showing how to add custom query vars, rewrite tags and rewrite rules to WordPress
<?php
/**
* @package Custom_queries
* @version 1.0
*/
/*
Plugin Name: Custom queries
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@butlerblog
butlerblog / columns.css
Created November 14, 2018 13:29 — forked from studiopress/columns.css
Genesis column classes.
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
@butlerblog
butlerblog / lastname-firstname-user-sort.php
Created December 22, 2016 05:37 — forked from ramseyp/lastname-firstname-user-sort.php
Sorted the return of a Wp_User_Query by both the last name value and the first name value. This way, if multiple users have the same last name, those particular users are then sorted by first name.
<?php
function s25_member_loop() {
$args = array(
'role' => 'member', // the role we're targeting
'exclude' => '1', // exclude admin
'fields' => 'all_with_meta',
'meta_key' => 'last_name', //query on the last_name key
'meta_key' => 'first_name', // also the first_name key
);
$membersquery = new WP_User_Query( $args );
<?php
/**
* Customize Event Query using Post Meta
*
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/