Skip to content

Instantly share code, notes, and snippets.

@bearded-avenger
bearded-avenger / blur.less
Created October 27, 2014 13:20
CSS Blur - No IE Support
.abs-pos-img-div {
position: absolute;
top:0;
left:0;
width:100%;
height:100%;
background-size:cover;
background-position:center center;
z-index: 0;
.translate3d(0, 0, 0);
/**
* Gets a number of posts and displays them as options
* @param array $query_args Optional. Overrides defaults.
* @return array An array of options that matches the CMB options array
*/
function cgc_get_posts_for_cmb( $query_args ) {
$args = wp_parse_args( $query_args, array(
'post_type' => array('post'),
'numberposts' => -1,
@bearded-avenger
bearded-avenger / menu.js
Created October 22, 2014 18:24
Simple off-canvas menu
jQuery(document).ready(function($){
$('a').click(function(e){
e.preventDefault()
$('body').toggleClass('menu-open');
});
});
@bearded-avenger
bearded-avenger / layout.md
Last active August 29, 2015 14:07
Takeover Layout Methods in WordPress

I have a WordPress plugin that runs as a custom post type. It creates a special layout that's used together with Aesop Story Engine to allow quick and unique story creation. The alpha version of this is done with template_include to override a single post type story template.

Because of the unique and particular layout of the story, I need to ensure that no other assets are being loaded on these specific story pags, and preferrably no markup as well. The alpha version does this by building up it's own template, consequently removing wp_head and wp_footer all together.

This plus side of this, is that special layout and design are guarnateed to work with any theme or plugin. The page only loads 2 files, the files necessary to work. The header http://cl.ly/image/2D1o0l071z2a and footer http://cl.ly/image/2D1o0l071z2a are clean.

The downside of this, is that other plugins won't work on the specially designed story pages without hooking into the specific hooks available in teh story page.

  1. Is the fact that o
@bearded-avenger
bearded-avenger / gist:e9d7ec26b0675bbc208a
Created September 16, 2014 16:24
Full Screen Components in Make
/*
- .aesop-on-THEMENAME is a class that aesop applies to themes
- this breaks the width that sets on main column
- .single targeting only single posts
*/
.aesop-on-make.single .container {
max-width:100%;
padding-left:0;
padding-right:0;
}
@bearded-avenger
bearded-avenger / gist:f478639cbf0847c48230
Last active February 27, 2016 09:32
Aesop Story Engine - Full Screen Components in Genesis
.aesop-on-genesis .site-inner{
max-width:100%;
}
.aesop-on-genesis .entry {
padding-left:0;
padding-right:0;
}
.aesop-on-genesis .entry-header,
.aesop-on-genesis .entry-content > *:not(.aesop-component) {
width: 100%;
@bearded-avenger
bearded-avenger / index.html
Last active January 2, 2016 23:29
CrowdHoster Campaign Theme
<!-- Start Aesop Crowdhoster -->
<blockquote>
<p>...one of the most beautiful tools for Wordpress that I&#39;ve seen in a long time.</p>
<cite>- <a href="http://wptavern.com/aesop-story-engine-an-open-source-wordpress-plugin-for-storytelling">WP Tavern</a></cite></blockquote>
<blockquote>
<p>...a potentially seismic shift in content creation and the biggest thing to hit WP for ages.</p>
<cite>- <a href="http://wptavern.com/aesop-story-engine-an-open-source-wordpress-plugin-for-storytelling#comment-50657">Chris Knowles</a></cite></blockquote>
<blockquote>
@bearded-avenger
bearded-avenger / Gruntfile.js
Last active January 2, 2016 21:29
CG Cookie GruntFile
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
// watch our project for changes
watch: {
compass: {
@bearded-avenger
bearded-avenger / sslcontrol.php
Created December 19, 2013 16:41
Do SSL only on checkout page in Wordpress.
<?php
/**
* SSL Controls
*/
class flackerSSLControl {
function __construct(){
add_action( 'template_redirect', array($this,'url_change' ),1);
@bearded-avenger
bearded-avenger / sharedcounts.php
Created December 19, 2013 16:04
Get total share counts of a Wordpress post and cache with transient.
function aesop_share_count(){
$post_id = get_the_ID();
//$url = 'http://nickhaskins.co'; // this one used for testing to return a working result
$url = get_permalink();
$apiurl = sprintf('http://api.sharedcount.com/?url=%s',$url);