This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
window.Album = Backbone.Model.extend({ | |
isFirstTrack: function(index) { | |
return index == 0; | |
}, | |
isLastTrack: function(index) { | |
return index >= this.get('tracks').length - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | |
<link rel="apple-touch-icon-precomposed" sizes="114x114" href=img/icons/114x114.png"> | |
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/icons/72x72.png"> | |
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="img/icons/57x57.png"> | |
<link rel="apple-touch-startup-image" href="img/icons/splash-screen.png" /> | |
<body onload="setTimeout(function() { if(Modernizr.touch && window.pageYOffset <= 1) window.scrollTo(0, 1) }, 100);"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- Helpful things to keep in your <head/> | |
// Brian Blakely, 360i | |
// http://twitter.com/brianblakely/ | |
--> | |
<head> | |
<!-- Disable automatic DNS prefetching. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get multiple values with one DB query | |
$post_meta = get_post_custom(); | |
$prefix = 'my_custom_field_'; | |
$value_1 = $post_meta[$prefix . '1'][0]; | |
$value_2 = $post_meta[$prefix . '2'][0]; | |
$value_3 = $post_meta[$prefix . '3'][0]; | |
// Get a single value | |
$value = get_post_meta(get_the_ID(), 'my_custom_field', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html class="no-js" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml" lang="en-US"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Untitled</title> | |
<style type="text/css"> | |
body { background: white; color: #999; font-family: sans-serif; } | |
h1 { color: #333; } | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parses a URL and returns the correct video ID based on service. | |
* | |
* @param string $url the URL to parse | |
* @param string $service 'youtube', 'vimeo' etc. | |
* | |
* @return string | |
*/ | |
function get_video_id($url, $service = 'youtube') { | |
$match = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_post_thumbnail_feeds($content) { | |
global $post; | |
if(has_post_thumbnail($post->ID)) { | |
$content = '<div>' . get_the_post_thumbnail($post->ID, 'medium') . '</div>' . $content; | |
} | |
return $content; | |
} | |
add_filter('the_excerpt_rss', 'add_post_thumbnail_feeds'); | |
add_filter('the_content_feed', 'add_post_thumbnail_feeds'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used to alter main loop. For secondary loops use get_posts() or make a new instance of WP_Query() | |
<?php | |
query_posts( array ( 'post_type' => 'artists', 'posts_per_page' => -1, 'order' => 'ASC' ) ); | |
if(have_posts()) : while (have_posts()) : the_post(); | |
?> | |
<!-- stuff like the_title(); --> | |
<?php | |
endwhile; | |
endif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used for secondary loops. To alter main loops use query_posts() instead. | |
// Documentation: http://codex.wordpress.org/Function_Reference/get_posts | |
global $post; | |
$post_backup = $post; | |
$myposts = get_posts( array('numberposts' => 5, 'offset'=> 1, 'category' => 1 )); | |
foreach( $myposts as $post ) { | |
setup_postdata($post); | |
the_content(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$default_query = array( | |
'posts_per_page' => -1, | |
'post_type' => 'kunstnere', | |
'order' => 'ASC', | |
'orderby' => 'meta_value', | |
'meta_key' => 'artist_meta_time_input', | |
'meta_query' => array( | |
array( | |
'key' => 'artist_meta_scene_select', | |
'value' => 'Scene 1', |