Skip to content

Instantly share code, notes, and snippets.

View FutureMedia's full-sized avatar
💭
I may be slow to respond.

Lefteris Theodossiadis FutureMedia

💭
I may be slow to respond.
View GitHub Profile
@FutureMedia
FutureMedia / about.md
Last active October 3, 2015 09:37 — forked from luetkemj/wp-query-ref.php
All possible WP query attributes

All available WP query attributes

WordPress Query Comprehensive Reference Compiled by luetkemj - luetkemj.com

CODEX

@FutureMedia
FutureMedia / infinite-scroll-masonry-imagesloaded.php
Last active August 29, 2015 14:10 — forked from gregrickaby/infinite-scroll-masonry-imagesloaded.php
Portfoglio List with Mansory, Infinite Scroll & Images Loaded
/**
* Be sure to include library scripts in this order. Can be placed either
* in the header or footer.
*/
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
$xs: ( max: 767px );
$sm: ( min: 768px );
$md: ( min: 992px );
$lg: ( min: 1200px );
$sm-only: ( min: map-get($sm, min), max: map-get($md, min) - 1 );
$md-only: ( min: map-get($md, min), max: map-get($lg, min) - 1 );
@mixin breakpoint($map) {
$query: "";
@if map-has-key($map, min) { $query: append($query, "(min-width: #{map-get($map, min)})") }
@FutureMedia
FutureMedia / Fragmented Caching.php
Last active August 29, 2015 14:02 — forked from markjaquith/gist:2653957
by Mark Jaquith
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
/**
* RETORNA URL DO POST_THUMBNAIL PARA BACKGROUND-IMAGE
* @param int: get_the_ID()
* @param string: thumbnail, medium, large, full
**/
function post_thumbnail_url($post_id, $size = 'thumbnail'){
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size );
$url = $thumb[0];
return $url;
}
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}