Skip to content

Instantly share code, notes, and snippets.

View KittenCodes's full-sized avatar

Phe Ledwell KittenCodes

View GitHub Profile
@KittenCodes
KittenCodes / skip-spans.js
Last active June 29, 2021 19:13
Table of Contents - Skip Spans
jQuery(document).ready( function() {
// If we're in the builder, return and don't execute.
if( window.angular ) { return; }
// Skip spans
$("span").parent().attr("toc-skip", "1");
@KittenCodes
KittenCodes / close-modal-on-scroll.js
Created June 13, 2021 19:59
Close Modal when page scrolls
jQuery(document).ready(function() {
jQuery('a[href^="#"]').click(function() {
// smooth scroll
jQuery('html, body').animate({
scrollTop: $($.attr(this, 'href')).offset().top
}, 500);
// close modal
@KittenCodes
KittenCodes / code_Block_Above_Repeater_CSS.css
Last active March 22, 2023 19:00
Get images from ACF gallery in a Oxygen Repeater when the datasource is an ACF Repeater and add a lightbox to the Gallery
/*
* Add this to the CSS tab of the Code Block ABOVE the Repeater:
*/
.thumbnail img {
box-sizing: border-box;
border: 1px solid #ddd;
padding: 2px;
margin: 0 1% 15px 0;
width: 32.6667%;
@KittenCodes
KittenCodes / containsposts.php
Created May 5, 2021 10:34
Post Type Doesn't Contain Posts Condition
<?php
// Set your post type
$my_post_type = 'post';
if( function_exists('oxygen_vsb_register_condition') ) {
global $oxy_condition_operators;
oxygen_vsb_register_condition('Contains Posts', array('options'=>array('true', 'false'), 'custom'=>false), array('=='), 'search_has_results_callback', 'Query Has Posts');
@KittenCodes
KittenCodes / categories.css
Created March 27, 2021 10:43
Show a list of taxonomies using a Code Block
.category-post-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.category-post {
width: 33.33%;
}
@KittenCodes
KittenCodes / loop-through-categories.css
Created February 12, 2021 14:18
Loop through categories in a taxonomy and display the output
.taxonomy-container {
width: 100%;
flex-direction: row;
display: flex;
flex-wrap: wrap;
}
.taxonomy-div {
width: 33.33%;
display: flex;
@KittenCodes
KittenCodes / form.css
Created January 31, 2021 09:28
Login & Registration Form
/* tabbed list */
ul.tabs_login {
padding: 0; margin: 20px 0 0 0;
position: relative;
list-style: none;
font-size: 14px;
z-index: 1000;
float: left;
}
ul.tabs_login li {
@KittenCodes
KittenCodes / animate-waypoints.css
Last active February 11, 2023 06:16
jQuery for using Animate CSS & Waypoints JS with Oxygen
/* Add this to a stylesheet via Manage > Stylesheets in the top right of the builder */
.wp-embed-responsive .cssAnimate {
opacity: 0;
}
@KittenCodes
KittenCodes / php.php
Created December 27, 2020 09:44
Decoded PHP
Post: 13135
<?php
wp_enqueue_style('splide-css');
wp_enqueue_script('splide');
?>
<?php
//echo "hello world!";
@KittenCodes
KittenCodes / svg.txt
Created November 27, 2020 14:27
Oxygen Default SVG Icons
a:2:{s:12:"Font Awesome";s:591781:"<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1">
<defs>
<symbol id="FontAwesomeicon-glass" viewBox="0 0 32 32">
<title>glass</title>
<path class="path1" d="M30.339 3.321q0 0.625-0.768 1.393l-11.286 11.286v13.714h5.714q0.464 0 0.804 0.339t0.339 0.804-0.339 0.804-0.804 0.339h-16q-0.464 0-0.804-0.339t-0.339-0.804 0.339-0.804 0.804-0.339h5.714v-13.714l-11.286-11.286q-0.768-0.768-0.768-1.393 0-0.411 0.321-0.652t0.679-0.313 0.768-0.071h25.143q0.411 0 0.768 0.071t0.679 0.313 0.321 0.652z"/>
</symbol>
<symbol id="FontAwesomeicon-music" viewBox="0 0 27 32">
<title>music</title>
<path class="path1" d="M27.429 4v20q0 0.893-0.607 1.589t-1.536 1.080-1.848 0.571-1.723 0.188-1.723-0.188-1.848-0.571-1.536-1.080-0.607-1.589 0.607-1.589 1.536-1.080 1.848-0.571 1.723-0.188q1.875 0 3.429 0.696v-9.589l-13.714 4.232v12.661q0 0.893-0.607 1.589t-1.536 1.080-1.848