Add your feed to SetSticker.com! Promote your sites and attract more customers. It costs only 100 EUROS per YEAR.
Pleasant surprises on every page! Discover new articles, displayed randomly throughout the site. Interesting content, always a click away
Alex Barber | Digital Artist
time to push the pixelsSort custom post archive by ACF datetime field 13 Dec 2016, 10:24 pm
function sort_events( $query ) {
// do not modify queries in the admin
if( is_admin() ) {
return $query;
}
// only modify queries for 'event' post type
if( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'event' ) {
$query->set('meta_key', 'start');
$query->set('meta_type', 'DATETIME');
$query->set('orderby', 'meta_value');
$query->set('order', 'DESC');
}
// return
return $query;
}
add_action('pre_get_posts', 'sort_events');
jQuery Event on Show/Hide 15 Feb 2016, 9:10 pm
Needed this to fire a script when an element display changed from none to block.
http://viralpatel.net/blogs/jquery-trigger-custom-event-show-hide-element/
NextGen Gallery 1.9 sort order fix 9 Nov 2015, 11:48 pm
Using NextGen Gallery 1.9? Sort order all fubar?
https://wordpress.org/support/topic/update-sort-order-not-working
How to sort 2 dimensional array by column value 9 Sep 2015, 4:06 pm
Stackoverflow comes in handy once again. I need to sort a multidimensional array by values in one column.
http://stackoverflow.com/questions/16096872/how-to-sort-2-dimensional-array-by-column-value
Get WordPress image caption 1 Jul 2015, 7:40 pm
http://stackoverflow.com/questions/1616281/is-there-a-function-to-get-the-caption-for-an-image-in-wordpress
“Turns out captions are stored as post excerpts.”
<?php echo $post->post_excerpt; ?>
Get ACF field without processing 1 Jul 2015, 7:37 pm
$image = get_field(‘image’, $post->ID, false);
$image = get_field(‘image’, false, false);
htaccess redirect domain to a page on another domain 23 Apr 2015, 5:13 pm
RewriteCond %{HTTP_HOST} ^(www\.)?domain1.com$ [NC]
RewriteRule ^oldpagename$ http://externalsite/page [R=301,L]
from: http://stackoverflow.com/questions/11540138/htaccess-rewrite-rule-to-redirect-specific-page-on-specific-domain-to-another-ur
Filtering div display with jQuery 25 Feb 2015, 9:33 pm
Clean solution:
http://codepen.io/terf/blog/jquery-filter-divs
And even tighter:
http://codepen.io/simeydotme/pen/ewKBr
HTML5 Header for Thematic 16 Feb 2015, 5:24 pm
Found this post about filtering Thematic for HTML 5:
http://scottnix.com/html5-header-with-thematic/
jQuery detect input fields are blank 10 Oct 2014, 8:27 pm
Used this one to check if all hidden fields in a form were blank, and prevent form submit if they were.
https://stackoverflow.com/questions/5599504/jquery-detect-input-fields-are-blank
// check if hidden fields are all blank
var allBlank = true;
$('input.searchhidden').each(function() {
return allBlank = allBlank && !$(this).val();
});
if ( allBlank ) {
console.log('empty');
e.preventDefault();
}