Skip to content

Instantly share code, notes, and snippets.

View jackabox's full-sized avatar
🛠️
Available for Hire

Jack Whiting jackabox

🛠️
Available for Hire
View GitHub Profile
@jackabox
jackabox / hideLinks.js
Last active August 29, 2015 14:05
Hiding Li's over a max length
@jackabox
jackabox / autolink.php
Created August 12, 2014 15:21
Autolink in PHP
@jackabox
jackabox / relatedTags.php
Created August 12, 2014 15:50
WordPress: related posts by tags
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) { ?>
<div class="related-posts">
<?php
$first_tag = $tags[0]->term_id;
$tagsIDs = array();
@jackabox
jackabox / grid.scss
Last active August 29, 2015 14:07
Generating a grid in sass.
// Your columns are at a weird width here - Use the gutter on the row as well.
$width: 1244px;
$columns: 12;
$gutter: 16px;
.row {
width: 100%;
max-width: $width;
box-sizing: border-box;
@jackabox
jackabox / loop.php
Created January 5, 2015 15:26
Custom posts, by custom taxonomy.
<?php
$categories = get_terms( 'service-category' );
foreach ( $categories as $category ) {
$services = new WP_Query(
array(
'post_type' => 'services',
'showposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'service-category',
@jackabox
jackabox / gallery.md
Last active August 29, 2015 14:21
Overflowing horizontally div, which scrolls on hot spot hover.
@jackabox
jackabox / betterScrollingDivs.md
Last active August 29, 2015 14:21
Allowing content to scroll smoothly with the parent container.
@jackabox
jackabox / modal.html
Last active December 14, 2015 01:49
Creating a JS function to fire a reveal model on a link.
<div id="arbitrary-modal" class="reveal-modal medium">
<div class="modal-content"></div>
<a class="close-reveal-modal">&#215;</a>
</div>
@jackabox
jackabox / custom.js
Created March 26, 2013 21:00 — forked from drewjoh/custom.js
Bootstap Load Ajax data into Modal Window
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {
@jackabox
jackabox / header.php
Last active December 19, 2015 10:19
Using jQuery to Toggle a Search Box
<div id="sarea">
<form id="searchform" action="<php echo home_url( '/' ); >" method="get" role="search">
<input id="s" type="text" name="s" value="" placeholder="Search Here & Hit Enter">
</form>
</div>
<a href="#" id="sbutton"> Search </a>