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
(function( $ ) { | |
$.fn.photoswipe = function(options){ | |
var galleries = [], | |
_options = options; | |
var init = function($this){ | |
galleries = []; | |
$this.each(function(i, gallery){ | |
galleries.push({ | |
id: i, |
<?php | |
/* | |
Description: qTranslate Support for Google XML Sitemaps Generator for WordPress | |
Copyright(c): 2011, DSmidge, http://blog.slo-host.com/ | |
License: GNU GPL, http://www.gnu.org/licenses/gpl-3.0.txt | |
This code is based on changes between plugin "Google XML Sitemaps Generator | |
with qTranslate Support for WordPress, v3.1.6.3" by NeoEGM and "Google XML | |
Sitemaps Generator for WordPress, v3.1.6" by Arne Brachhold. |
<?php | |
//This is a filter to change the default validation message that Gravity Forms generates | |
add_filter('gform_validation_message', 'change_validation_message', 10, 2); | |
function change_validation_message($message, $form) | |
{ | |
return "<div class='validation_error'><strong>Oops!</strong> Looks like there’s something wrong. Please review the form above.</div>"; | |
} | |
// Often forms in Gravity Forms to need to start with default values and we need to check the form in case the user hasn't entered new data and give them a validation message back |
<?php | |
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
function enqueue_my_styles() { | |
global $wp_styles; | |
// Load the main stylesheet | |
wp_enqueue_style( 'my-theme', get_stylesheet_uri() ); |
/* 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 { |
/*************************************************************** | |
* 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; |
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.
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; |