Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Schutzsmith schutzsmith

View GitHub Profile
@schutzsmith
schutzsmith / query.php
Created Nov 24, 2021
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.
View query.php
<?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 Jun 14, 2021
WordPress Block Pattern for Horizontal Card
View horizontal-card.html
<!-- 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 Jun 14, 2021
WordPress Block Pattern for Call To Action Horizontal
View call-to-action-horizontal.html
<!-- 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 Jun 14, 2021
WordPress Block Pattern for Jumbotron
View jumbotron.html
<!-- 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 Jun 13, 2021
WordPress Block Pattern for Call To Action Vertical
View call-to-action-vertical.html
<!-- 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 Jun 13, 2021
WordPress Block Pattern for Pricing Columns
View pricing-columns.html
<!-- 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
@schutzsmith
schutzsmith / hide.php
Created Mar 5, 2020
hide plugin notifications
View hide.php
add_action('admin_head', 'handpressed_custom_admin_css');
function handpressed_custom_admin_css() {
echo '<style>
#updraft-wrap .updated, #mceu_13, #ac-pro-version, #direct-feedback, .elementor-message {
display: none !important;
}
</style>';
}
@schutzsmith
schutzsmith / removexmlrpc.php
Last active Apr 15, 2019
Remove XML RPC in WordPress
View removexmlrpc.php
//add to functions.php
add_filter( 'xmlrpc_enabled', '__return_false' );
//add to .htaccess
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
@schutzsmith
schutzsmith / removerss.php
Created Apr 14, 2019
Remove RSS Feeds From WordPress
View removerss.php
<?php
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds
remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed
remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link
remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.
remove_action( 'wp_head', 'index_rel_link' ); // index link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link
remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post.
remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version
@schutzsmith
schutzsmith / removeadminbar.php
Created Apr 14, 2019
Remove Admin Bar in WordPress
View removeadminbar.php
// remove admin bar
add_filter('show_admin_bar', '__return_false');