Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Spellhammer / gist:5c6deef489deed21865f52215fd1425d
Created April 12, 2019 13:27
Flex Gallery last two images only 33.333% width
#_gallery-17-2 a:nth-last-child(1),
#_gallery-17-2 a:nth-last-child(2) {
max-width: calc(33.333% - 10px - 10px);
}
#_gallery-17-2 {
justify-content: flex-start;
}
@Spellhammer
Spellhammer / MovingObjectSlider
Last active October 25, 2019 12:42
Custom JavaScript "slider" with movable HTML element (similar to Trello.com home page slider) for Oxygen
jQuery(document).ready( function() {
var sliderpos = 1;
sliderEngine( sliderpos );
jQuery('.advance-slider').click( function() {
sliderpos += 1;
sliderEngine( sliderpos );
@Spellhammer
Spellhammer / addNavLinks.js
Created December 10, 2019 11:24
JS snippet for adding custom nav links quickly in WordPress
@Spellhammer
Spellhammer / changelog.txt
Last active January 28, 2020 15:10
Oxygen 3.2 Beta 1 Changelog
## 2020/01/28
## Oxygen 3.2 Beta 1 Changelog
------------------------------
Tweak: Improved shortcode encoding by centralizing the encoding function
Tweak: Adjusted the way Oxygen handles "blank" shortcodes during save failure to reduce chance of content deletion
Fix: Section backgrounds are no longer output inline unless they're set dynamically or via Gutenberg
Fix: WooCommerce cart total element no longer breaks things
@Spellhammer
Spellhammer / 3.2 RC 1 Changelog
Last active February 18, 2020 03:40
3.2 RC 1 Changelog
## 2020/02/18
## Oxygen 3.2 RC 1 Changelog
------------------------------
Polish: Continued improvement of Pro Menu element, fixed various bugs and polished features
Fix: Corrected regression preventing Oxygen dynamic data from working in image alt field
Fix: Corrected regression preventing transition duration CSS from being output when set via a class
@Spellhammer
Spellhammer / gist:08dcd4634399d3e0ccf1e2dbea171f61
Created March 10, 2020 13:13
WooCo Product Thumbnails As Navigation "Dots"
#-product-images-8-117 .flex-control-thumbs {
padding: 16px 32px 16px 32px;
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}
#-product-images-8-117 .woocommerce-product-gallery .flex-control-thumbs > li {
min-width: 0px;
@Spellhammer
Spellhammer / Oxygen 3.2.1 RC 1 Changelog
Last active March 18, 2020 14:47
Oxygen 3.2.1 RC 1 Changelog
## 2020/03/18
## Oxygen 3.2.1 RC 1 Changelog
------------------------------
Polish: Improved cursor interaction for animated dropdowns that don't intersect with the cursor.
Tweak: Made entire parent menu item (instead of only the icon) trigger mobile toggle dropdown if the parent menu item's href is #.
Tweak: Prevented mouse interaction with animated dropdowns when they're animating out.
Enhancement: Added a min-width control for mobile menu link items.
Enhancement: Added width control for the Pro Menu off-canvas menu.
Fix: Corrected issue causing full-screen mobile menu to close when triggering mobile toggle dropdowns.
@Spellhammer
Spellhammer / 3.2.1.final.changelog
Created March 25, 2020 11:41
Oxygen 3.2.1 Changelog
## 2020/03/25
## Oxygen 3.2.1 Changelog
------------------------------
Polish: Improved cursor interaction for animated dropdowns that don't intersect with the cursor.
Tweak: Made entire parent menu item (instead of only the icon) trigger mobile toggle dropdown if the parent menu item's href is #.
Tweak: Prevented mouse interaction with animated dropdowns when they're animating out.
Enhancement: Added a min-width control for mobile menu link items.
Enhancement: Added width control for the Pro Menu off-canvas menu.
Fix: Corrected issue causing full-screen mobile menu to close when triggering mobile toggle dropdowns.
@Spellhammer
Spellhammer / manual-active-menu-items.js
Created April 23, 2020 15:33
Manually set active menu styles using JS.
jQuery(document).ready( function() {
var path = window.location;
jQuery(".menu-item a").each(function () {
var href = jQuery(this).attr('href');
if(path == href) {
jQuery(this).closest('li').addClass('current-menu-item');
@Spellhammer
Spellhammer / getuserfield
Created April 28, 2020 15:10
Get field from current user's Profile (ACF)
// Get field from current user's profile
function get_user_field( $field_name ) {
if( !$field_name ) { return; }
$user = "user_" . get_current_user_ID();
if( $field_name ) {
return get_field( $field_name, $user );
}