Skip to content

Instantly share code, notes, and snippets.

http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
For the high quality version of the thumbnail use a url similar to this:
@csknk
csknk / Clickable Div for Wordpress
Created October 10, 2013 12:06
Make a div clickable - jQuery snippet that finds and links to an anchor within the div.
jQuery(document).ready(function($){
$(".post_thumb").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
});
jQuery(document).ready(function($){
$(window).load(function(){
var outerHeightTotal = 0;
$('.homeside_1').each(function(){
outerHeightTotal += $(this).outerHeight();
});
var totalH = outerHeightTotal ;
$('.home_wrapper').css('min-height', totalH+'px');
@csknk
csknk / gist:7335868
Last active December 27, 2015 13:49
Next and Previous Projects function attached to a Thesis 2.1 hook
/**Next & previous project links**/
function add_next_project() {
// Next two lines link to project custom post types in same category
?><div class ="half"><?php echo previous_post_link('%link', '&laquo View the Previous Project', TRUE);?></div><?php
?><div class="half_right"><?php echo next_post_link('%link', 'View the Next Project &raquo', TRUE);?></div><?php
// Next two lines link to next/previous project CPT without category filter
@csknk
csknk / gist:7337581
Last active December 27, 2015 13:59
Infinite Next/Previous links for CPT = project, attached to a Thesis 2.1 hook
/**Infinite next & previous project links**/
function add_next_project() {
if( get_adjacent_post(false, '', true) ) {
?><div class ="half"><?php echo previous_post_link('%link', '&laquo View Previous Project');?></div><?php
}
else {
@csknk
csknk / Next & Previous Posts Links
Created November 6, 2013 15:17
Next and Previous Post Links, Thesis 2.1 hook
@csknk
csknk / Back to blog page link
Created November 6, 2013 15:25
Back to Blog Page Link attached to Thesis 2.1 hook
@csknk
csknk / Responsive video container
Created November 6, 2013 16:13
CSS code for responsive video
/**Put video embeds in this div for responsive behaviour**/
.video_wrapper {
position: relative;
padding-bottom: 74.25%; /* for a 4:3 aspect ratio */
/* change padding-bottom to : 56.25% for 16:9 ratio, 50% for 16:10 ratio */
padding-top: 30px;
height: 0;
overflow: hidden;
margin-bottom: $MainPad;
}
@csknk
csknk / global_scripts
Created November 11, 2013 18:14
Javascript for all pages - mobile responsive menu and back to top button
jQuery(document).ready(function($) {
// Responsive Menu
// prepend menu icon
$('#nav_wrap').prepend('<div id="menu_icon">Menu</div>');
// toggle nav
$("#menu_icon").on("click", function(){
$('#menu-main-menu').fadeToggle(700);
@csknk
csknk / siteurl_fix
Last active December 28, 2015 10:29
Temporary siteurl fix for WordPress migration
<?php
// Enable following line temporarily after migration
update_option('siteurl','http://www.thenewsiteurl.com/sub');update_option('home','http://www.thenewsiteurl.com/sub');
?>