Skip to content

Instantly share code, notes, and snippets.

View schutzsmith's full-sized avatar

Daniel Schutzsmith schutzsmith

View GitHub Profile
@schutzsmith
schutzsmith / wp-config.php
Created May 5, 2022 15:43
WPMU allow specific users as admin
define( 'WPMUDEV_LIMIT_TO_USER', '1, 10, 15' );
@schutzsmith
schutzsmith / index.html
Created January 19, 2022 18:35
Pull in current weather from Weather.gov and display font awesome icons with Javascript/jQuery and Bootstrap
<div class="d-flex align-items-center" id="weatherBox">
<div><div class="fa-3x"><span class="condition"></span> <span class="temp"></span></div></div>
<div class="ml-3">
<strong class="conditiontext"></strong><br>
<small>Wind: <span class="conditionwind"></span></small>
</div>
</div>
@schutzsmith
schutzsmith / ipaddresses.txt
Last active January 4, 2022 21:25
IP Addresses to allow for WPMU Services
18.204.159.253
54.227.51.40
45.55.78.242
35.171.56.101
192.241.140.159
104.236.132.222
192.241.148.185
34.196.51.17
35.157.144.199
159.89.254.12
@schutzsmith
schutzsmith / functions.php
Created December 9, 2021 23:38
ACF All Import Pro Setup
/**
* Add custom field info to Media attachment after import from All Import Pro
*/
function my_attachment_uploaded($pid, $attid, $filepath){
$attachment = get_post($attid);
$embed_content = '<!-- wp:acf/pinellas-pdf-embed \{"id":"block_619bf48i9iq90ie09qi09e","name":"acf/pinellas-pdf-embed","data":\{"field_60da08c0ddbb4":"'.$attid.'"\},"align":"","mode":"preview"\} /-->';
$prev_url = get_field(previous_url, $pid);
$prev_date = get_field(date_imported, $pid);
$prev_by = get_field(imported_by, $pid);
@schutzsmith
schutzsmith / query.php
Created November 24, 2021 16:46
WordPress query for a custom post type of "Events" that sorts by custom fields made in Advanced Custom Fields called "staart_date" and "start_time". I use two different fields because I wanted more control to do things like this.
<?php
return array(
'post_type' => 'events',
'posts_per_page' => '5',
'meta_key' => 'start_date',
'meta_query' => array(
'relation' => 'AND',
'date_clause' => array(
'key' => 'start_date',
'compare' => '=',
@schutzsmith
schutzsmith / horizontal-card.html
Last active June 14, 2021 15:54
WordPress Block Pattern for Horizontal Card
<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:media-text {"align":"full","mediaPosition":"right","mediaId":44,"mediaLink":"http://blockpatterns.local/patterns-playground/mackerel_beach_house_-_black__white_perspective/","linkDestination":"custom","mediaType":"image","mediaWidth":32,"verticalAlignment":"top","imageFill":true,"backgroundColor":"white","className":"is-style-twentytwentyone-border"} -->
<div class="wp-block-media-text alignfull has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-top is-image-fill is-style-twentytwentyone-border has-white-background-color has-background" style="grid-template-columns:auto 32%"><figure class="wp-block-media-text__media" style="background-image:url(http://blockpatterns.local/wp-content/uploads/2021/06/Mackerel_Beach_House_-_Black__White_Perspective.jpg);background-position:50% 50%"><a href="#"><img src="http://blockpatterns.local/wp-content/uploads/2021/06/Mackerel_Be
@schutzsmith
schutzsmith / call-to-action-horizontal.html
Last active June 14, 2021 15:47
WordPress Block Pattern for Call To Action Horizontal
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"18px","right":"0px","bottom":"36px","left":"36px"}}},"backgroundColor":"black"} -->
<div class="wp-block-group alignfull has-black-background-color has-background" style="padding-top:18px;padding-right:0px;padding-bottom:36px;padding-left:36px"><div class="wp-block-group__inner-container"><!-- wp:columns {"align":"full"} -->
<div class="wp-block-columns alignfull"><!-- wp:column {"width":"66.66%"} -->
<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:heading {"textAlign":"left","style":{"typography":{"lineHeight":"1"}}} -->
<h2 class="has-text-align-left" style="line-height:1"><strong>Become A Monthly Patron</strong></h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.3"}},"textColor":"white"} -->
<p class="has-white-color has-text-color" style="line-height:1.3">Our organization relies on regular donations to continue our support of the artistic community in the form of grants, classes, and specia
@schutzsmith
schutzsmith / jumbotron.html
Last active June 14, 2021 15:39
WordPress Block Pattern for Jumbotron
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"18px","right":"18px","bottom":"18px","left":"18px"}}},"backgroundColor":"black","textColor":"white"} -->
<div class="wp-block-group alignwide has-white-color has-black-background-color has-text-color has-background" style="padding-top:18px;padding-right:18px;padding-bottom:18px;padding-left:18px"><div class="wp-block-group__inner-container"><!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column {"width":"66.66%"} -->
<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:heading {"textAlign":"left","textColor":"green"} -->
<h2 class="has-text-align-left has-green-color has-text-color"><strong>Native American Art</strong></h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"textColor":"white"} -->
<p class="has-white-color has-text-color">Encompasses the visual artistic practices of the indigenous peoples of the Americas from ancient times to the present. </p>
<!-- /wp:paragraph -->
@schutzsmith
schutzsmith / call-to-action-vertical.html
Last active June 13, 2021 17:25
WordPress Block Pattern for Call To Action Vertical
<!-- wp:heading {"textAlign":"center"} -->
<h2 class="has-text-align-center"><strong>Section Title</strong></h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"align":"center","textColor":"gray"} -->
<p class="has-text-align-center has-gray-color has-text-color">Something short and leading about the collection below—its contents, the creator, etc. Make it short and sweet, but not too short so folks don’t simply skip over it entirely.</p>
<!-- /wp:paragraph -->
<!-- wp:buttons {"contentJustification":"center"} -->
<div class="wp-block-buttons is-content-justification-center"><!-- wp:button -->
@schutzsmith
schutzsmith / pricing-columns.html
Last active June 13, 2021 17:13
WordPress Block Pattern for Pricing Columns
<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:group {"style":{"spacing":{"padding":{"top":"0px","right":"0px","bottom":"0px","left":"0px"}}},"backgroundColor":"white","className":"is-style-twentytwentyone-border"} -->
<div class="wp-block-group is-style-twentytwentyone-border has-white-background-color has-background" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><div class="wp-block-group__inner-container"><!-- wp:paragraph {"align":"center","backgroundColor":"black","fontSize":"extra-large"} -->
<p class="has-text-align-center has-black-background-color has-background has-extra-large-font-size"><strong>Free</strong></p>
<!-- /wp:paragraph -->
<!-- wp:paragraph {"align":"center","style":{"typography":{"lineHeight":"1"}},"fontSize":"extra-small"} -->
<p class="has-text-align-center has-extra-small-font-size" style="line-height:1"><strong><em>Ideal for developers</em></strong></p>
<!-- /wp:pa