Skip to content

Instantly share code, notes, and snippets.

<?php query_posts('category_name=Portfolio&order=ASC&orderby=date&posts_per_page=36'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
$url = $thumb['0'];
?>
<li><a style="background-image:url(<?=$url?>);" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"></a></li>
// there is a solution for jQuery < 1.9.0, where you can use `$.browser`:
// https://gist.github.com/nathansmith/950767
// but jQuery removed `$.browser` in version 1.9.0, so you have to get another way:
function last_child() {
if (/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())) {
$('*:last-child').addClass('last-child');
}
}
body{background-color:green;}
.container{
position: relative;
z-index:1;
width:100px;
height:100px;
margin:30px;
border:1px solid red;
overflow:hidden;
color:red;
@heckmac
heckmac / fbImageReq.html
Created February 26, 2013 18:48
angularjs: facebook image request
<div ng-app="module" ng-controller="fbImageReqCtrl">
<img ng-src='{{url}}' />
</div>
@heckmac
heckmac / angularjs: ng-class switch
Last active December 14, 2015 01:19
angular switch ng-class
<a href="" ng-click="predicate = '';reverse=false;" class="btn btn-small btn-views btn-views-left" ng-class="{active: predicate == ''}"><span class="icon-dataview"></span>DATA</a>
<a href="" ng-click="predicate = 'points'; reverse=true;" ng-class="{active: predicate == 'points'}"class="btn btn-small btn-views btn-views-right"><span class="icon-vote"></span>VOTI</a>
<!-- alternative way -->
<a ng-class="{admin:'enabled', moderator:'disabled', '':'hidden'}[user.role]">{{{admin:'enabled', moderator:'disabled', '':'hidden'}[user.role]}}</a>
/**
* AngularUI - The companion suite for AngularJS
* @version v0.3.2 - 2012-12-04
* @link http://angular-ui.github.com
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
angular.module('ui.config', []).value('ui.config', {});
angular.module('ui.filters', ['ui.config']);