Skip to content

Instantly share code, notes, and snippets.

View KittenCodes's full-sized avatar

Phe Ledwell KittenCodes

View GitHub Profile
@KittenCodes
KittenCodes / flipbox.css
Last active November 19, 2020 21:47
CSS for Building A Flipbox In WordPress With Oxygen
.flipbox {
position: relative;
}
.flipbox__front,
.flipbox__back {
transition: 0.7s all ease-in-out;
backface-visibility: hidden;
}
@KittenCodes
KittenCodes / tippy.js
Created September 19, 2020 07:32
Tippy JavaScript
document.addEventListener("DOMContentLoaded", function() {
tippy('[data-tippy-content]', {
animation: 'shift-away',
});
})
@KittenCodes
KittenCodes / tippy.html
Created September 19, 2020 07:31
Tippy PHP & HTML
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<link
rel="stylesheet"
href="https://unpkg.com/tippy.js@6/animations/shift-away.css"
/>
@KittenCodes
KittenCodes / off-canvas-menu.json
Created March 22, 2020 19:42
Oxygen Off Canvas Menu Preset
{"name":"AlwaysOffCanvas","options":{"original":{"globalConditionsResult":true,"oxy-pro-menu_show_mobile_menu_below":"always","oxy-pro-menu_mobile_menu_open_icon":"FontAwesomeicon-bars","oxy-pro-menu_mobile_menu_open_icon_text":"Open","oxy-pro-menu_slug_oxypromenumobileopeniconsvg_width|height":"32","oxy-pro-menu_slug_oxypromenumobileopeniconsvg_margin_right":"16","oxy-pro-menu_slug_oxypromenumobileopenicon_background_color":"color(6)","oxy-pro-menu_slug_oxypromenumobileopeniconsvg_color":"color(13)","oxy-pro-menu_-oxy-pro-menu-mobile-open-icon_typography_font-family":"Oswald","oxy-pro-menu_-oxy-pro-menu-mobile-open-icon_typography_font-size":"18","oxy-pro-menu_-oxy-pro-menu-mobile-open-icon_typography_color":"color(13)","oxy-pro-menu_off_canvas":"true","oxy-pro-menu_slug_oxypromenuoffcanvascontaineroxypromenulistmenuitemoxypromenuopencontaineroxypromenulistmenuitem_min_width-unit":"%","oxy-pro-menu_slug_oxypromenuoffcanvascontaineroxypromenulistmenuitemoxypromenuopencontaineroxypromenulistmenuitem_min_width"
@KittenCodes
KittenCodes / modal.js
Created February 20, 2020 13:28
jQuery to create Lightbox popup using Oxygen's Modal element
jQuery('.lightbox-trigger').click( function() {
var image = jQuery(this).attr('src');
jQuery('.lightbox-popup').css('background-image', 'url(' + image + ')');
var caption = jQuery(this).next().text();
jQuery('.lightbox-popup-caption').text( caption );
@KittenCodes
KittenCodes / events-archive.css
Created February 6, 2020 09:17
The Events Calendar - Events Archive
.ct-code-block .tribe-common--breakpoint-medium.tribe-events .tribe-events-l-container {
padding: 0;
}
@KittenCodes
KittenCodes / event-popup.php
Created November 24, 2019 10:39
The Events Calendar - Event Popup
function tribe_add_gridview_class( $classes ) {
if ( is_post_type_archive( 'tribe_events' ) && tribe_is_month()) {
$classes[] = 'events-gridview';
return $classes;
} else {
$classes[] = '';
return $classes;
}
}
add_filter( 'body_class', 'tribe_add_gridview_class', 999 );
@KittenCodes
KittenCodes / events-archive.php
Last active March 13, 2020 20:27
The Events Calendar - Events Archive
<?php
use Tribe\Events\Views\V2\Template_Bootstrap;
echo tribe( Template_Bootstrap::class )->get_view_html();
?>
@KittenCodes
KittenCodes / single-event.php
Last active October 15, 2021 18:00
The Events Calendar - Single Event
<?php
$events_label_singular = tribe_get_event_label_singular();
$events_label_plural = tribe_get_event_label_plural();
$event_id = get_the_ID();
?>
<div id="tribe-events-content" class="tribe-events-single">
@KittenCodes
KittenCodes / updatestockprice.md
Last active January 30, 2023 06:39
Update WooCommerce Price & Stock levels with WP All Import

Update WooCommerce price & stock levels with WP All Import

You will need an import file that contains the new stock value, price information and the variation SKU. For this process to work correctly, your products will need to have unique SKUs.

  1. Create an "Existing Items" import to WooCommerce Products: https://d.pr/i/c5daMc
  2. On Step 3 of the import process, leave the Product Type set to Simple, add the new price information to the General tab (https://d.pr/i/P6XQhC) and the new stock value to the Inventory tab: https://d.pr/i/iN9S5t
  3. On Step 4 of the import process, select to match on the custom field _sku and add the SKU element from your import file: https://d.pr/i/7EwWTl
  4. Also on Step 4, select to update the custom fields _price, _regular_price, _sale_price, _stock and _manage_stock only: https://d.pr/i/c1iZm7