Skip to content

Instantly share code, notes, and snippets.

@jevgen
jevgen / gist:2005757
Created March 9, 2012 09:04 — forked from jayj/gist:1190106
Full code for tutorial on Jayj.dk
<?php
/**
* Custom "Download" custom type for tutorial on Jayj.dk
*
* @link http://jayj.dk/2011/download-cpt-wordpress
*/
add_action( 'init', 'jayj_create_download_post_type' );
@jevgen
jevgen / responsive.html
Created March 14, 2012 15:42 — forked from lensco/responsive.html
Simple responsive design test page. More info here: http://bricss.net/post/16538278376/simple-responsive-design-test-page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@jevgen
jevgen / gist:2038088
Created March 14, 2012 17:32 — forked from srobbin/gist:1976643
Backstretch Demo: Basic
/*
At its core, Backstretch is a one-line plugin.
Just pass in the path to an image, and you're done.
*/
$.backstretch("http://dl.dropbox.com/u/515046/www/garfield-interior.jpg");
@jevgen
jevgen / gist:2070550
Created March 18, 2012 11:01 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
<?php
/**
* Better Limit Submissions Per Time Period by User or IP
* http://gravitywiz.com/2012/05/12/limit-ip-to-one-submission-per-time-period
*/
class GWSubmissionLimit {
private $_args;
<?php
// standard usage
new GWEmailDomainControl(array(
'form_id' => 152,
'field_id' => 9,
'domains' => array('gmail.com', 'hotmail.com', 'test.com')
));
// all options
<?php
// add the following to your functions file or similar
define( 'FUBLO_GF_PROFILE', 1 ); // define the ID number of your profile form.
// ============================================================= PROFILE EDITING
/**
* These are the user metadata fields, with their names and the data about them.
<?php
/**
* Gravity Wiz // Require Minimum Character Limit for Gravity Forms
*
* Adds support for requiring a minimum number of characters for text-based Gravity Form fields.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
<div class="sixcol first">
<h2>This Month</h2>
<?php
//This gets the current month starting at day 1, and the next month starting at day 1
$now = mktime(0, 0, 0, date("m"), 1, date('Y'));
$then = mktime(0, 0, 0, (date("m") % 12 + 1), 1, date('Y'));
query_posts(