This file contains hidden or 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
$('a[href*=#]').each(function() { | |
if($(this).attr('href').indexOf("#") === 0) { | |
$(this).click(function(e) { | |
e.preventDefault(); | |
var targetOffset = $($(this).attr('href')).offset().top - 50; | |
$('body').animate({scrollTop: targetOffset}, 700); | |
}); | |
} | |
}); |
This file contains hidden or 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
// add class | |
$(".target").addClass(".class"); |
This file contains hidden or 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
<?php | |
$args = array ( | |
'orderby' => 'year_published', | |
'order' => ASC, | |
); | |
query_posts($args); ?> | |
<?php while (have_posts()) : the_post(); ?> |
This file contains hidden or 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
<?php if(get_field('custom_page_title')) { ?> | |
<?php the_field('custom_page_title'); ?> | |
<?php } else { ?> | |
<?php echo roots_title(); ?> | |
<?php } ?> |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
<?php | |
// define category slug and name | |
$category = 'authors'; // Taxonomy Name | |
$categoryName = 'Authors'; // Front-end / Plural Name | |
$categorySingle = 'Author'; // Front-end Singular Name | |
// end definition | |
$terms = get_the_terms( $post->ID , $category ); | |
$total = count ($terms); | |
$i=1; |
This file contains hidden or 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
<?php if(get_sub_field('external_link')) { ?> | |
<a target="_blank" href="<?php the_sub_field('external_link'); ?>"> | |
<?php } elseif(get_sub_field('internal_link')) { ?> | |
<a href="<?php the_sub_field('internal_link'); ?>"> | |
<?php } else { ?> | |
<?php } ?> | |
<?php the_sub_field('slider_title'); ?></a> |
This file contains hidden or 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
// scroll to top on page load | |
$(document).ready(function(){ | |
$(window).scrollTop(0); | |
}); |
This file contains hidden or 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 () { | |
var activeTab = $('[href=' + location.hash + ']'); | |
activeTab && activeTab.tab('show'); | |
}); |
This file contains hidden or 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
$(window).resize(function() { | |
$('#content').height($(window).height() - 46); | |
}); | |
$(window).trigger('resize'); |