Skip to content

Instantly share code, notes, and snippets.

View reediredale's full-sized avatar

Reed Iredale reediredale

View GitHub Profile
@reediredale
reediredale / Contract Killer 3.md
Last active November 1, 2019 00:39
Without legal-ese contract.

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

<?php // check if the flexible content field has rows of data
if( get_field('flexible_content') ):
// loop through the rows of data
while ( has_sub_field('flexible_content') ) :
if( get_row_layout() == 'copy' ):
get_template_part('partials/copy', 'block');
⠀⠀⠀⠀⠀⠀⠀⣠⠂⠉⠁⢢
⠀⠀⠀⠀⠀⠀⠀⡆⠀⠀⠀⢸
⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠸
⠀⠀⣀⣀⣀⣀⣠⠇⠀⠀⠀⢠⡀
⢰⠏⣰⠉⠀⠀⠸⠀⠀⡀⠀⢀⠏⠉⠑⡖⠒⠄
⠌⠀⡇⠀⠀⠀⠀⠂⠀⠀⠀⠸⠀⠀⠀⡇⠀⠈⢦
⡀⠀⠷⠀⠀⠀⠀⠀⠀⠀⠀⠐⠀⠀⠀⠡⠀⠀⠈⣇
⠉⢺⡅⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⢰⡇
⠀⠀⠙⠺⣥⢄⠀⠀⠈⠉⠉⠀⠀⠉⢀⠎⠀⠀⠞
⠀⠀⠀⠀⠈⠑⠢⠄⣀⣀⣀⣀⠤⠤⠤⠔⠊⠁
@reediredale
reediredale / Query Page Children Loop
Created September 16, 2017 10:51
Query Page Children Loop
<?php
$the_query = new WP_Query(array(
'post_type' => 'page',
'post_parent' => '9947'
));
while ($the_query->have_posts())
{ ?>
<div class="d-1of3">
<?php $the_query->the_post();
....................../´¯/)
....................,/¯../
.................../..../
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯\
........('(...´...´.... ¯~/'...')
.........\.................'...../
..........''...\.......... _.·´
............\..............(
..............\.............\
<!--
__ __ _ __ ___ __ _____ __ ________
/ / ___ / /( )_____ / |/ /___ _/ /_____ / ___// /___ __/ __/ __/
/ / / _ \/ __/// ___/ / /|_/ / __ `/ //_/ _ \ \__ \/ __/ / / / /_/ /_
/ /___/ __/ /_ (__ ) / / / / /_/ / ,< / __/ ___/ / /_/ /_/ / __/ __/
/_____/\___/\__/ /____/ /_/ /_/\__,_/_/|_|\___/ /____/\__/\__,_/_/ /_/
http://iredale.co
-->
default android/drawable-mdpi/, 150% android/drawable-hdpi/, 200% android/drawable-xhdpi/, 300% android/drawable-xxhdpi/, 400% android/drawable-xxxhdpi/, 100% iphone/, 200% iphone/@2x, 300% iphone/@3x
@reediredale
reediredale / gist:86fa059bbece9bb76e9c
Created May 1, 2015 05:29
Wrap certain words in Javascript
<script>
$('option').each(function(){ // Choose what kind of tag this is already in
var sort = $(this).text().replace(/Sort by/g,"<div class="bold">Sort by</div>");
$(this).html(sort);
});
</script>
@reediredale
reediredale / gist:7e8f1f7ebf2ee61611cb
Created November 24, 2014 01:38
Gravity Forms Datepicker No Weekends
<script>
jQuery(document).bind('gform_post_render', function(){
// destroy default Gravity Form datepicker
jQuery("#input_2_3").datepicker('destroy');
// create new custom datepicker
var oneWorkingDays = new Date();
var adjustments = [0, 1, 1, 1, 1, 1, 0]; // Offsets by day of the week
oneWorkingDays.setDate(oneWorkingDays.getDate() + 1 + adjustments[oneWorkingDays.getDay()]);
jQuery("#input_2_3").datepicker({ beforeShowDay: jQuery.datepicker.noWeekends, minDate: '+1d', gotoCurrent: true, prevText: '', showOn: 'both', buttonImage: '/wp-content/plugins/gravityforms/images/calendar.png', buttonImageOnly: true });
<?php
$myname = get_post_meta($post->ID, 'header_image', true);
if ( $myname ) { ?>
<img class="feature" src="<?php the_field('header_image'); ?>">
<?php }
else {
echo '';
}
?>