Skip to content

Instantly share code, notes, and snippets.

View pommiegranit's full-sized avatar

Chris Knowles pommiegranit

  • Melbourne, Australia
View GitHub Profile
@pommiegranit
pommiegranit / webhooks_action.php
Last active October 13, 2015 18:21
MailChimp webhooks for WordPress
<?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
pommiegranit / add_placeholder.js
Last active August 29, 2015 14:09
Custom styles for PopUp Pro from WPMU Dev
jQuery('document').ready(function($){
$('input[name=subscription-email]').attr('placeholder','Enter your email address...');
});
@pommiegranit
pommiegranit / mywidget-basic.php
Last active August 30, 2018 12:54
Playing with WordPress widgets
<?php
/*
Plugin Name: My Widget
Plugin URI: http://mydomain.com
Description: My first widget
Author: Me
Version: 1.0
Author URI: http://mydomain.com
*/
@pommiegranit
pommiegranit / add_background_image.php
Created November 12, 2014 00:57
Make featured image background on WP posts and most recent post's featured image background on home page.
// 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
pommiegranit / background-shifting.js
Last active August 29, 2015 14:08
Snippets for WordPress Story creation
// build scenes for background shifting
new ScrollScene({triggerElement: 'header', duration: jQuery('header').height() + win_height})
.setClassToggle(bg_el, 'middle') // add class toggle
.addTo(controller);
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
.addTo(controller);
new ScrollScene({offset: jQuery('#pg-1574-6').offset().top - win_height, duration: jQuery('#pg-1574-6').height() + win_height})
@pommiegranit
pommiegranit / fullpage_apple.css
Last active November 2, 2020 13:52
fullPage.js For WordPress
/* Style for header texts
* --------------------------------------- */
h1{
font-size: 5em;
font-family: arial,helvetica;
margin:0;
padding:0;
}
h2{
font-size: 2em;
@pommiegranit
pommiegranit / bgvideo_shortcode_eg.html
Last active August 29, 2015 14:06
WordPress Background Video
[bgvideo width="1280" height="720"
mp4="http://www.test.dev/wp-content/uploads/2014/09/rainier.mp4"
webm="http://www.test.dev/wp-content/uploads/2014/09/rainier.webm"
poster="http://www.test.dev/wp-content/uploads/2014/09/rainier-cover-1024x576.jpg"
fixed="no"]
@pommiegranit
pommiegranit / clientside.js
Last active August 29, 2015 14:06
Part of the enhanced comments plugin
jQuery(document).ready(function($){
// 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
pommiegranit / gestures_init.js
Created September 8, 2014 07:48
Initialization script for Tocca js in WordPress
jQuery(document).ready(function($){
$(gestures.container).on('dbltap', function(){
jQuery(location).attr('href', gestures.destination );
}
).on('swipeleft', function() {
@pommiegranit
pommiegranit / slideout-comments.css
Last active August 29, 2015 14:06
Slideout Comments
.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;