Skip to content

Instantly share code, notes, and snippets.

View johnmccole's full-sized avatar
💭
I may be slow to respond.

John McCole johnmccole

💭
I may be slow to respond.
  • Glasgow, Scotland
View GitHub Profile
$positions: (
static: 'static',
relative: 'relative',
absolute: 'absolute',
fixed: 'fixed',
stick: 'sticky'
);
$grid-breakpoints: (
xs: 0,
// include Lenis script where appropriate (e.g. enqueued in setup.php).
// https://unpkg.com/[email protected]/dist/lenis.min.js
// Lenis settings
const lenis = new Lenis({
duration: 1.2,
easing: (t) => (t === 1 ? 1 : 1 - Math.pow(2, -10 * t)),
direction: "vertical",
gestureDirection: "vertical",
smooth: true,
<?php $count = $query->found_posts; ?>
<?php
$id = get_the_ID();
?>
<article class="<?= get_post_type() ?>-entry cpt-entry">
<div class="d-flex">
<div class="col-12 col-lg-6">
<div class="img-holder p-5 h-100" style="background: url(<?= get_the_post_thumbnail_url() ?>) no-repeat center / cover;"></div>
// Populate Form Fields
// ID
add_filter( 'gform_field_value_ID', 'populate_ID' );
function populate_ID( $value ) {
$id = get_the_ID();
return $id;
}
// Job Title
add_filter( 'gform_field_value_jobTitle', 'populate_jobTitle' );
function populate_jobTitle( $value ) {
@johnmccole
johnmccole / carousel.blade.php
Last active September 12, 2023 09:49
Add a modal trigger to an <a> tag, add slide-to on the <img> tag.
@johnmccole
johnmccole / block-functions.php
Last active September 18, 2023 10:03
Add custom ACF Pro custom Gutenberg blocks to a Bootscore child theme. NOTE: block.json MUST be called block.json, any other name will not work. Wildcards do not work for block directories either, must be named. ![](https://cdn.cacher.io/attachmen
<?php
/**
* We use WordPress's init hook to make sure
* our blocks are registered early in the loading
* process.
*
* @link https://developer.wordpress.org/reference/hooks/init/
*/
function register_acf_blocks() {
/**
.slick {
width: 100%;
max-width: 960px;
.slick-list {
overflow: visible;
.slick-slide {
opacity: 0.2;
transition: opacity 400ms ease-out;
// Custom search form
add_filter('get_search_form', function () {
$form = '';
echo template('partials.search');
return $form;
});
@php
// Get current post ID.
$id = get_the_ID();
// Get Relationship from post using it's ID
$posts = get_field('posts', $id);
$post_ids = array();
$post_types = array();