Skip to content

Instantly share code, notes, and snippets.

View bfintal's full-sized avatar
🎯
Focusing

Benjamin Intal bfintal

🎯
Focusing
View GitHub Profile

Features

Multiple Demos, Single Installation

With WordPress multisite you can create multiple "sites" within the same WordPress instance. Each can have a different look, feel, theme, and plugins activated. Each works as it's own "site" in a network.

WordPress Demo uses the power of multisite to allow your visitors to create unique sandboxes for each "site" within your network. This also allows you to demonstrate different themes and plugins, all with the same WordPress install.

What is a sandbox?

A sandbox is a carbon copy of your demonstration site where your users can try out every aspect of your product without affecting your main demo site. Sandboxes get deleted 24 hours after the user has stopped being active or has logged out.

global $wpdb;
$results = $wpdb->get_results( "select post_author, count(*) post_num from wp_posts where post_type in ('page', 'post', 'cpt') group by post_author" );
@bfintal
bfintal / gist:99488bb2019bca89ac48
Created January 13, 2015 01:23
Twenty Fifteen Social Genericons
.social-navigation a[href$="/feed/"]:before {
content: "\f413";
}
.social-navigation a[href*="codepen.io"]:before {
content: "\f216";
}
.social-navigation a[href*="digg.com"]:before {
content: "\f221";
array (size=81)
'address' =>
array (size=5)
'class' => boolean true
'id' => boolean true
'style' => boolean true
'title' => boolean true
'role' => boolean true
'a' =>
array (size=10)
// line 436
// return wp_get_attachment_image_src( $id, 'full' );
return wp_get_attachment_image_src( $id, array( 1600, 1100 ) );
// line 447
// return wp_get_attachment_image_src( $attachmentID, 'full' );
return wp_get_attachment_image_src( $attachmentID, array( 1600, 1100 ) );
(function(){;
// File start: /var/deployments/www.raptor-editor.com.3/raptor-gold/raptor-dependencies/jquery-no-conflict.js
var jQuery = window.jQuery.noConflict(true);
var $ = jQuery;
window['raptor'] = jQuery;
;
// File end: /var/deployments/www.raptor-editor.com.3/raptor-gold/raptor-dependencies/jquery-no-conflict.js
;
// File start: /var/deployments/www.raptor-editor.com.3/raptor-gold/raptor-dependencies/jquery-hotkeys.js
/*
@bfintal
bfintal / install-wp-tests.sh
Created September 5, 2015 05:53
Test installer that works both in Travis CI & locally with VVV
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
DB_PASS=$3
@bfintal
bfintal / install-wp-tests.sh
Created September 5, 2015 07:24
Test installer that works both in Travis CI & locally with VVV for newly scaffolded projects
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
DB_PASS=$3
<?php
if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly
}
class TitanFrameworkOptionUpload extends TitanFrameworkOption {
private static $firstLoad = true;
public $defaultSecondarySettings = array(
'size' => 'full', // The size of the image to use in the generated CSS
@bfintal
bfintal / CreateHGroups.js
Created September 30, 2011 04:47
Automatically wraps groups of headings (h1, h2, h3, h4, h5 and h6) into hgroups. Good for HTML5 styling.
jQuery(document).ready(function($){
var skip = 0;
$('h1, h2, h3, h4, h5, h6').each(function(i) {
if (skip > 0) {
skip--;
return;
}
var group = $(this).add($(this).nextUntil(':not(h1, h2, h3, h4, h5, h6)'));
skip = group.length - 1;