Skip to content

Instantly share code, notes, and snippets.


Chris Knowles pommiegranit

  • Melbourne, Australia
View GitHub Profile
pommiegranit / webhooks_action.php
Last active Oct 13, 2015
MailChimp webhooks for WordPress
View webhooks_action.php
function mcwh_action_webhook() {
$mcwh_settings = get_option( 'mcwh_settings' );
mcwh_log('==================[ Incoming Request ]==================');
// mcwh_log('Full _REQUEST dump:\n'.print_r($_REQUEST,true));
if ( empty($_POST) ) {
pommiegranit / add_placeholder.js
Last active Aug 29, 2015
Custom styles for PopUp Pro from WPMU Dev
View add_placeholder.js
$('input[name=subscription-email]').attr('placeholder','Enter your email address...');
pommiegranit / mywidget-basic.php
Last active Aug 30, 2018
Playing with WordPress widgets
View mywidget-basic.php
Plugin Name: My Widget
Plugin URI:
Description: My first widget
Author: Me
Version: 1.0
Author URI:
pommiegranit / add_background_image.php
Created Nov 12, 2014
Make featured image background on WP posts and most recent post's featured image background on home page.
View add_background_image.php
// Custom Background Images
// Use featured image on posts
// Use the most recent post's featured image on home page (or default background image)
function add_background_image() {
global $post;
if (is_admin()) return;
pommiegranit / background-shifting.js
Last active Aug 29, 2015
Snippets for WordPress Story creation
View background-shifting.js
// build scenes for background shifting
new ScrollScene({triggerElement: 'header', duration: jQuery('header').height() + win_height})
.setClassToggle(bg_el, 'middle') // add class toggle
new ScrollScene({offset: jQuery('#pg-1574-5').offset().top - parseInt(jQuery('#pg-1574-5').css('margin-top')) - win_height, duration: parseInt(jQuery('#pg-1574-5').css('margin-top')) + jQuery('#pg-1574-5').height()})
.setClassToggle(bg_el, 'topright') // add class toggle
new ScrollScene({offset: jQuery('#pg-1574-6').offset().top - win_height, duration: jQuery('#pg-1574-6').height() + win_height})
pommiegranit / fullpage_apple.css
Last active Nov 2, 2020
fullPage.js For WordPress
View fullpage_apple.css
/* Style for header texts
* --------------------------------------- */
font-size: 5em;
font-family: arial,helvetica;
font-size: 2em;
pommiegranit / bgvideo_shortcode_eg.html
Last active Aug 29, 2015
WordPress Background Video
View bgvideo_shortcode_eg.html
[bgvideo width="1280" height="720"
pommiegranit / clientside.js
Last active Aug 29, 2015
Part of the enhanced comments plugin
View clientside.js
// move the buried comments to the bottom of the list
if ( encom.buried == 'bottom' ) {
var comments = $(encom.comment + '.buried').detach();
$(encom.container).append( comments );
// remove buried comments
if ( encom.buried == 'remove' ) {
pommiegranit / gestures_init.js
Created Sep 8, 2014
Initialization script for Tocca js in WordPress
View gestures_init.js
$(gestures.container).on('dbltap', function(){
jQuery(location).attr('href', gestures.destination );
).on('swipeleft', function() {
View slideout-comments.css
.comments-wrapper {
position: fixed;
bottom: 0px;
right: -50%;
width: 51%;
background: #fff;
padding: 10px;
z-index: 10;
border-width: 1px 0 1px 1px;
border-style: solid;