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($) { | |
$.fn.pluginName = function(options) { | |
var defaultOptions = { | |
option1: 'ahrengot', | |
option2: true, | |
option3: false | |
} | |
var options = $.extend(defaultOptions, options); | |
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 inArray(arr, val) { | |
for (var i = 0; i < arr.length; i++) { | |
if (arr[i] == val) return true; | |
} | |
return false; | |
} |
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
var toggle = function(selector, parentSelector, switchMode, onSelect) { | |
var $items, | |
$containers; | |
this.init = function() { | |
$items = $(selector); | |
$containers = $items.parents(parentSelector); | |
$items.each(function() { | |
$(this).data('container', $(this).parents(parentSelector)); | |
}); |
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 ParallaxScroll() { | |
this.$window = $(window); | |
this.items = new Array(); | |
this.init = function() { | |
this.$window.scroll(doParallax); | |
} | |
var doParallax = function() { | |
// Check we have any items before we do any scolling |
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', |
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
// 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
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
/** | |
* 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 = ''; |
OlderNewer