Skip to content

Instantly share code, notes, and snippets.

View schutzsmith's full-sized avatar

Daniel Schutzsmith schutzsmith

View GitHub Profile
@schutzsmith
schutzsmith / removerss.php
Created April 14, 2019 05:24
Remove RSS Feeds From WordPress
<?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 / removexmlrpc.php
Last active April 15, 2019 21:33
Remove XML RPC in WordPress
//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 / hide.php
Created March 5, 2020 14:49
hide plugin notifications
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 / 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 / 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
@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 / 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 / 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 / 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 / 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);