Skip to content

Instantly share code, notes, and snippets.

<?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(

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
diff --git a/wp-content/plugins/qtranslate/qtranslate_core.php b/wp-content/plugins/qtranslate/qtranslate_core.php
index 17b4669..9ac128a 100644
--- a/wp-content/plugins/qtranslate/qtranslate_core.php
+++ b/wp-content/plugins/qtranslate/qtranslate_core.php
@@ -414,6 +414,7 @@ function qtrans_updateTermLibrary() {
function qtrans_strftime($format, $date, $default = '', $before = '', $after = '') {
// don't do anything if format is not given
+ return $default;

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

/***************************************************************
* Function media_custom_validation
* Check the media form for duplicate inputs on the same day
***************************************************************/
add_filter('gform_validation', 'media_custom_validation');
function media_custom_validation($validation_result) {
global $form_email, $file_id;
@jevgen
jevgen / homebrew.md
Last active August 29, 2015 14:17 — forked from thomjoy/homebrew.md

Homebrew

Uninstall

rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

Install cask

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@jevgen
jevgen / Contract Killer 3.md
Last active August 29, 2015 14:27 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@jevgen
jevgen / Styling Gravity Forms Error Messages
Last active September 3, 2015 19:30 — forked from scottmcdaniel/Styling Gravity Forms Error Messages
Styling Gravity Forms Error Messages
/* Gravity forms error handling - February 5, 2014 */
/* ############################################### */
/* Make the error stand out */
.gfield_error{
background-color: white;
color:#b94a48;
}
/* Prepend the error message to the missing but required field */
.gfield_error:before {
@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' );