Skip to content

Instantly share code, notes, and snippets.

View AaronRutley's full-sized avatar

Aaron Rutley AaronRutley

  • Melbourne, Australia
View GitHub Profile
@AaronRutley
AaronRutley / ar_save_testimonials_to_content.php
Last active December 30, 2020 14:48
Save ACF Testimonials to post content
<?php // Save ACF Testimonials to post content
function ar_save_testimonials_to_content( $post_id ) {
// Only run this code if we're on a particilar post / page
if( $post_id === 1234 ) {
// Start an output buffer
ob_start();
// Loop over our testimonials
@AaronRutley
AaronRutley / post_to_slack.php
Last active March 11, 2020 00:07
post_to_slack.php
<?php
/**
* Post a message to Slack from WordPress
*
* @param string $message the message to be sent to Slack
* @param string $channel the #channel to send the message to (or @user for a DM)
* @param string $username the username for this bot eg : WordPress bot
* @param string $icon_emoji the icon emoji name for this bot eg :monkey:
*
@AaronRutley
AaronRutley / wp query.php
Last active April 2, 2019 13:35 — forked from billerickson/gist:3698476
wp query
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@AaronRutley
AaronRutley / gist:07c38c01130391e91bef
Last active May 6, 2018 18:49
Slick Responsive Photo Gallery with Sass
// width as a readable fraction
$whole : 100%;
$half : 50%;
$third : 33.3333%;
$quater : 25%;
$sixth : 16.6666%;
// gallery breakpoints
$gallery-breakpoint-small: em(0);
$gallery-breakpoint-medium: em(640);

New computer setup

  • a/o 2015-05-27 *

Format the drive

  1. Restart with cmd-R or cmd-D
  2. Erase drive / 3x if second-handk
  3. Reinstall MacOS
@AaronRutley
AaronRutley / keybase.md
Created July 19, 2017 06:31
keybase.md

Keybase proof

I hereby claim:

  • I am aaronrutley on github.
  • I am aaronrutley (https://keybase.io/aaronrutley) on keybase.
  • I have a public key ASBzb1uA4KUevirp6YyfU502POCLNUueKtrGegputpECMwo

To claim this, I am signing this object:

<?php
if (have_rows('my_repeater_field')) {
$mycounter = 0;
while (have_rows('my_repeater_field')) {
the_row();
$mycounter++;
echo $mycounter;
}
}
?>
<?php
function ar_custom_project_endpoint($data) {
$args = array(
'posts_per_page' => -1,
'offset' => 0,
'category' => '',
'category_name' => '',
'orderby' => 'title',
'order' => 'ASC',
<?php
function ar_register_project_meta() {
register_api_field(
'project',
'meta',
array(
'get_callback' => 'ar_register_project_meta_get',
)
);
}
@AaronRutley
AaronRutley / atom-styles.css
Last active April 26, 2016 05:32
atom-styles.css
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/