Skip to content

Instantly share code, notes, and snippets.

View samjco's full-sized avatar

Sam C. samjco

View GitHub Profile
@dn7734
dn7734 / single-photogallery.php
Created June 12, 2017 08:14
ACF + isotope-layout + magnific-popup.js = gallery
<?php
do_action('get_header');
//get_template_part('templates/header');
?>
<?php //get_template_part('templates/partials/breadcrumbs'); ?>
<?php //get_template_part('templates/base'); ?>
<?php if( have_rows('gallery') ): $i=0;?>
@kasrak
kasrak / create_record.php
Last active June 15, 2021 14:20
Create a record in Airtable using PHP
<?php
$data = array(
"fields" => array(
"Name" => "Hello world"
)
);
$data_json = json_encode($data);
$ch = curl_init("https://api.airtable.com/v0/YOUR_BASE_ID/YOUR_TABLE_NAME?api_key=YOUR_API_KEY");
@wajdijurry
wajdijurry / ArrayManipulation.php
Last active July 6, 2021 15:21
Adding item to array or change existent item position after shifting elements up or down depending on available positions
<?php
/**
* Author:Wajdi Jurry <[email protected]> (https://github.com/wajdijurry)
* Gist: https://gist.github.com/wajdijurry/a00752123134342ccc9d13a480c9f013
*/
class ArrayManipulation
{
private $array;
public function __construct(array $array)
@eclarrrk
eclarrrk / get-gravity-forms-entries.php
Last active May 29, 2022 22:46
Display Gravity Form entries into WordPress page template
<?php
/*
Official Gravity Forms documentation on get_entries() found here:
https://docs.gravityforms.com/api-functions/#get-entries
*/
/* Gravity Form ID. */
$form_id = '20';
/* Sorting options avalable but left blank for simplicity. */
@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 );
@michelegiorgi
michelegiorgi / formality_hooks_sample.php
Last active December 20, 2023 00:06
Formality hooks reference
<?php
/**
* Formality hooks reference
*
* @link https://formality.dev
* @since 1.1
* @package Formality
* @author Michele Giorgi <[email protected]>
*/