Skip to content

Instantly share code, notes, and snippets.

View KittenCodes's full-sized avatar

Phe Ledwell KittenCodes

View GitHub Profile
{"element":{"id":102,"data":{"type":"OxygenElements\\Container","properties":{"meta":{"classes":["2cb859b8-a7d9-49e1-a158-fe5892e28296"]},"settings":{"interactions":null,"override_variables":null}}},"children":[{"id":100,"data":{"type":"OxygenElements\\Container","properties":{"meta":{"classes":["b94e3099-c9de-4b0b-9b8f-25323c90ef92"]}}},"children":[{"id":101,"data":{"type":"OxygenElements\\Container","properties":{"meta":{"classes":["821ed02e-c563-4fe5-a79d-ff0e949e883e","23ca5c68-a17e-4d7e-88fa-c76dc769a444"]}}},"children":[{"id":104,"data":{"type":"OxygenElements\\Image","properties":{"content":{"image":{"from":"media_library","lazy_load":true,"alt":"from_media_library","media":{"id":135,"filename":"icons8-student.png","url":"https://aviato.local/wp-content/uploads/2025/05/icons8-student.png","alt":"","caption":"","mime":"image/png","type":"image","sizes":{"full":{"url":"https://aviato.local/wp-content/uploads/2025/05/icons8-student.png","height":120,"width":120,"orientation":"landscape"}},"attributes":{"s
[{"id":"3eef63f8-b40e-4283-90d6-623e438f54da","name":"p","properties":{"breakpoint_base":{"typography":{"font_family":"{var-ef3664d5-5d79-47f5-a9e8-6ec01e988e9c}","font_weight":400,"font_size":{"number":"{var-17cc60c9-ed77-4bad-8629-8cfbf4c86517}","unit":"custom","style":"{var-17cc60c9-ed77-4bad-8629-8cfbf4c86517}"}}}},"children":[],"locked":false,"collection":"Collection 1","type":"custom"},{"id":"58b89d57-c3d3-4523-af91-323bc21ce7ec","name":"header-logo","properties":{"breakpoint_base":{"background":{"background_color":"{var-42e17fdf-6e06-49f0-85eb-5edcd07ab0e8}"},"size":{"width":{"number":4,"unit":"rem","style":"4rem"},"height":{"number":1.5,"unit":"rem","style":"1.5rem"},"min_width":{"number":192,"unit":"px","style":"192px"}},"spacing":{"spacing":{"padding":{"left":{"unit":"rem","number":2,"style":"2rem"},"top":{"number":2,"unit":"rem","style":"2rem"},"bottom":{"number":2,"unit":"rem","style":"2rem"},"right":{"unit":"rem","number":2,"style":"2rem"}}}},"layout":{"display":"flex","flex_align":{"primary_axis
@KittenCodes
KittenCodes / fix-gutenberg-image-2.php
Last active May 9, 2025 07:40
Fix: Oxygen Classic - WordPress v6.8 prevents changing images in Gutenberg
add_action('admin_head', 'oxygen_support_fix_gutenberg_image');
function oxygen_support_fix_gutenberg_image() {
echo '<style>
/* WordPress 6.8 CSS Override to allow images to be changed in Gutenberg */
.wp-block img.ct-image:not([draggable]) {
pointer-events: unset !important;
}
</style>';
}
@KittenCodes
KittenCodes / breakdance-hide-default-editor-button.php
Last active April 7, 2025 06:55
How to Hide the "Use Default Editor" Button in Breakdance Builder
<?php
add_action('admin_head', 'winusoft_conditional_remove_default_editor_button');
function winusoft_conditional_remove_default_editor_button() {
// Specify the Post IDs where the button should NOT be removed
$excluded_post_ids = []; // Replace with a comma separated list of your post IDs
// Get the current post ID
$current_post_id = isset($_GET['post']) ? intval($_GET['post']) : null;
@KittenCodes
KittenCodes / dynamic-colours-acf.php
Created March 21, 2025 18:52
Oxygen 6 - Dynamic Colours via ACF
<?php
// Add a dynamic CSS variable to the <head> of your site
add_action('wp_head', function() {
if (function_exists('get_field')) {
// Retrieve the value of the ACF field
$selected_colour = get_field('select_colour');
// Check if a value is set and split the value and label if necessary
if ($selected_colour) {
@KittenCodes
KittenCodes / fix-button-size.php
Created January 8, 2025 07:13
Fix Large Oxygen Edit Button
<?php
add_action('admin_head', 'oxygen_support_fix_editor_icon');
function oxygen_support_fix_editor_icon() {
echo '<style>
/* fix the Grid for non-full screen */
.editor-header edit-post-header {
@media (min-width: 782px) {
.editor-header:has(>.editor-header__center) {
@KittenCodes
KittenCodes / A How To.txt
Created June 10, 2024 07:58
Modern Events Calendar with Oxygen Builder
Set up the Single Event template:
- Go to Oxygen > Templates and create a template applied to Singular > mec-events
- Copy the JSON from "single-event.json" and paste it into the +JSON box on the template
- You can then edit the template in Oxygen and move the items around as needed
Set up the Events Archive template:
- Go to Oxygen > Templates and create a template applied to Archive > Post Types > Events
- Copy the JSON from "event-archive.json" and paste it into the +JSON box on the template
@KittenCodes
KittenCodes / framework.css
Last active May 7, 2024 18:22
Basic CSS Grid Framework
/* these root values can be adjusted. You can then use them in Oxygen like this: var(-gap-xs) */
:root {
/* Gap */
--gap-xs: 4px;
--gap-s: 8px;
--gap-m: 16px;
--gap-l: 32px;
--gap-xl: 64px;
<?php
// Get the terms for the current post, using the Director taxonomy
$post_terms = get_the_terms( get_the_ID(), 'director' );
// If there are terms
if ($post_terms) {
// Create an empty array to add links to
$terms_list = array();
@KittenCodes
KittenCodes / polylang_condition.php
Last active November 25, 2024 06:15
Language Conditions for Oxygen
<?php
if( function_exists('oxygen_vsb_register_condition') && function_exists('pll_languages_list') ) {
$lang_list = pll_languages_list();
oxygen_vsb_register_condition(
//Condition Name
'Locale',