Skip to content

Instantly share code, notes, and snippets.

@zackpyle
zackpyle / *Custom gallery and Magnific Popup.md
Last active July 27, 2023 01:07
Create a custom gallery layout + lightbox functionality including next / prev navigation buttons
@zackpyle
zackpyle / _Beaver-Themer-ACF-Hero.md
Last active May 18, 2023 13:56
Beaver Themer + ACF - Hero Section #beaverbuilder #beaverthemer

This is a download to make a Hero section on your pages using Beaver Themer and ACF.

- Steps to install -

  1. Download this whole Gist as a zip and extract
  2. Import the Hero Field Group (acf-hero-fields.json) into ACF (/wp-admin/edit.php?post_type=acf-field-group&page=acf-tools) - I like to exclude my Homepage for this fieldgroup as my homepage always has a custom hero section
  3. Paste the function for adding the body class (hero-bg-body-class.php) into your functions.php file or snippet plugin, leaving out the <?php at the beginning of the file
  4. Paste the hero styles CSS (hero-styles.css) into wherever you are writing your CSS (styles.css, customizer, BB Global CSS, etc)
  5. Use Wordpress importer (/wp-admin/import.php) to import the Themer Part (hero-themer-part.xml). Same as the ACF field group, I like to exclude my Homepage from this Themer Part as it always gets a custom hero
  6. Open the Themer Part with BB and edit the Row settings. For the Background Photo section, click on the wrench to set
@zackpyle
zackpyle / styles.css
Last active February 28, 2023 18:57
Starter CSS
/** TABLE OF CONTENTS
---------------------------------------------------------------------------/
1.0 - Global Styles
1.1 - General
1.2 - Selection Highlight
1.3 - Buttons
1.4 - Typography
1.5 - Custom Font Face
<script>
var time = new Date();
var dayOfWeek = time.getDay();
// Set office opening time to 8:15am
var startTime = new Date().setHours(8,15);
// Set office closing time to 4:15pm
var endTime = new Date().setHours(16,15);
@zackpyle
zackpyle / *Best Snippets*
Last active May 1, 2024 20:05
Best PHP/JS Snippets
This is a collection of my most used or most useful PHP and JS snippets
**Disclaimer, I didn't write most of these - I just curated them over the years**
.desktop-menu-wrap {
display: block;
width: 100%;
height: 100%;
position: relative;
transform: translateX(0);
transition: .3s ease all;
}
.desktop-menu-wrap.open {
jQuery(function($) {
// Toggles the Open Class so that CSS can take care of animating on and off the canvas
$('.desktop-menu-toggle').click(function() {
$('.desktop-menu-wrap').toggleClass('open');
});
});
<?php
// Creates New Nav/Menus
register_nav_menus( array(
'desktop_large' => 'Primary Large Desktop Menu',
'desktop_small' => 'Smaller Desktop Menu',
));
// Places the HTML high up into the DOM
@verticalgrain
verticalgrain / share-links.twig
Last active June 25, 2020 09:49
Timber twig wordpress static sharing links
@jesseeproductions
jesseeproductions / ecp-cf-3-9
Last active February 16, 2024 07:00
The Events Calendar Custom Fields and Capabilties@3.9
The Events Calendar Custom Fields @3.9
Event Custom Post Type ( tribe_events )
_EventAllDay
_EventStartDate
_EventEndDate
_EventDuration
_EventVenueID
_EventShowMapLink
_EventShowMap