Skip to content

Instantly share code, notes, and snippets.

@blueprintmrk
blueprintmrk / wordpress.vcl
Created June 19, 2021 01:31 — forked from Greg-Boggs/wordpress.vcl
Varnish 4 VCL configuration for WordPress. Also allows purging
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and http://varnish-cache.org/trac/wiki/VCLExamples for more examples.
@blueprintmrk
blueprintmrk / wordpress.vcl
Created June 19, 2021 01:29 — forked from matthewjackowski/wordpress.vcl
Varnish 4 VCL configuration for WordPress. Also allows purging
# A heavily customized VCL to support WordPress
# Some items of note:
# Supports https
# Supports admin cookies for wp-admin
# Caches everything
# Support for custom error html page
vcl 4.0;
import directors;
import std;
/* -- Start Story override code removes background 1x1 image -- */
.template-product .lazy-image {background-image: none !important;}
/* - end - */
@blueprintmrk
blueprintmrk / snippet_change_state_to_US_states_dropdown.php
Created May 26, 2021 02:10 — forked from matadorjobs/snippet_change_state_to_US_states_dropdown.php
Change the state/province application form field to a drop-down of US states and territories.
<?php // omit opening PHP tag
add_filter( 'matador_application_fields_structure', 'mdocs_change_state_field_to_US_states_dropdown', 50, 1 );
/**
* Matador Change "State" to US States Dropdown
*
* Change the state/province application form field to a drop-down (<select>) of US states and territories.
*
* @since 2021-02-22
*
* @param array $fields Array of Form Fields
<?php
/**
* Add Logo to Job Structured Data (JSON+LD)
*
* @see https://matadorjobs.com/support/documentation/add-a-logo-to-google-for-jobs-listings/
*
* @param array $ld the Job Structured Data before save.
* @return array $ld the modified Job Structured Data for saving.
*/
function mj_add_logo_to_job_jsonld( $ld ) {
@blueprintmrk
blueprintmrk / gist:9fc2ffce3ca85813cd38c99537bab6c9
Created May 23, 2021 18:19 — forked from matt-bailey/gist:3609369
Terminal - Rsync merge files/folders from one server to another
# Merge from remote to local (exclude .svn folders)
rsync -av --exclude '.svn' [username]@[server]:/[path-to-folder]/[folder] ./
--progress
# Use this flag to show progress
# ./ means merge into the current folder (it needs to exist!)
# Reverse paths to go from local to remote
@blueprintmrk
blueprintmrk / compatibility.js
Created October 17, 2020 00:06 — forked from danielpataki/compatibility.js
jQuery in WordPress
/* Regular jQuery */
$('.hideable').on('click', function() {
$(this).hide();
})
/* Compatibility Mode */
jQuery('.hideable').on('click', function() {
jQuery(this).hide();
})
@blueprintmrk
blueprintmrk / disable_transient_caching.php
Created October 3, 2020 21:34 — forked from tacoverdo/disable_transient_caching.php
Disable WordPress SEO transient caching
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/**
* Disables the XML Sitemap transient caching in WordPress SEO and WordPress SEO Premium.
* WARNING: This may lead to a heavier load on your server and your sitemaps being loaded less fast.
*/
add_filter( 'wpseo_enable_xml_sitemap_transient_caching', '__return_false' );
@blueprintmrk
blueprintmrk / yoast_seo_breadcrumbs_replace_woocommerce.php
Created October 3, 2020 21:33 — forked from tacoverdo/yoast_seo_breadcrumbs_replace_woocommerce.php
There are two sets of code in this gist. One for non-WooThemes and one for WooThemes. Only copy the section you need to replace breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Replace WooCommerce Breadcrumbs With Yoast Breadcrumbs
* Credit: Unknown
* Last Tested: Jan 25, 2018 using Yoast SEO 6.2 on WordPress 4.9.2
* Theme: Non-WooThemes like Twenty Seventeen, Genesis
*/
// Remove WooCommerce Breadcrumbs
{% when 'page' %}
<li>
<a href="{{ page.url }}" aria-current="page">{{ page.title }}</a>
</li>