Skip to content

Instantly share code, notes, and snippets.

View Kevin-LeMasters-PixelParade's full-sized avatar

Kevin-LeMasters-PixelParade

View GitHub Profile
@Kevin-LeMasters-PixelParade
Kevin-LeMasters-PixelParade / _breeze-smart-purge_readme.md
Last active February 20, 2026 11:56
Master Breeze Cache Strategy (Auto-Detect + Custom Map)

Master Breeze Cache Strategy (Auto-Detect + Custom Map)

The Problem

If you use Cloudways, the Breeze caching plugin, and Cloudflare Enterprise Edge Cache, you've likely run into this frustrating issue: When you update a Post or Custom Post Type (CPT), the parent listing pages, custom taxonomy archives, and Page Builder pages (like a Knowledge Base containing a post grid) do not update. By default, Breeze aggressively clears the cache for the single post ID you just edited, but it fails to recognize the complex relationships of modern WordPress sites built with custom post types or page builders.

The Solution

This snippet bridges the gap between Breeze and your site's architecture. It acts as a "Traffic Controller" for the Cloudflare/Varnish cache, doing two main things:

  1. Auto-Detection: It programmatically hooks into WordPress to find the CPT Archive and any assigned Custom Taxonomy pages (e.g., Event Categories) and adds them to the purge queue.
  2. Relationship Mapping: It include

Add responsive screen size buttons in css/scss preview iframe and increase width of iframe

image

image

Header will need to be set to sticky and overlay by default.

Simply add this script to your global JS or enque as a seperate script file.

How to Add Codebox Button to Admin Bar with wpcodebox,

  • create a PHP snippet
  • run snippet on page load
  • insert at admin_head

The snippet checks if logged in and only runs if true

Scss snippet added inline in admin footer to update WPcoedbox folder and snippet styles, and add a different color background to cloud snippets

Hide WPCodebox menu item and page from other users.

Make it availble to all admins with email of @agencyemail or by username

@Kevin-LeMasters-PixelParade
Kevin-LeMasters-PixelParade / _BeaverBuilder-Scrollspy-Bootstrap.md
Last active August 5, 2025 18:16
Easy Scrollspy setup for BB theme users running full Bootstrap 4 or anyone using Bootstrap 4 with/without BB

Easy Scrollspy setup for BB theme users running full Bootstrap 4 or anyone using Bootstrap 4 with BB.

For BB theme, enable full bootstrap 4 under customize > General > Layout (Or load it from CDN on a single page if not using it sitewide)

JS file add to BB page JS directly or load via external file in footer defered.

Currently using it with PowerPack's Table of Contents module, but this could be used for any list/menu of links, just change the data-target attribute.

I referred to this documentation when setting up