Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
introducing bugs into production.

Edward McIntyre twittem

💭
introducing bugs into production.
View GitHub Profile
@twittem
twittem / Javascript.html
Last active Dec 26, 2015
Example of loading Bootstrap JS in wordpress.
View Javascript.html
<script type="text/javascript">
(function($) {
$("[rel='tooltip']").tooltip();
$('#hover-cap-4col .thumbnail').hover(
function(){
$(this).find('.caption').slideDown(250); //.fadeIn(250)
},
function(){
@twittem
twittem / wp_bootstrap_navwalker 1.4.4.md
Last active Nov 22, 2017
wp_bootstrap_navwalker 1.4.4 for Twitter Bootstrap 2.3.2
View wp_bootstrap_navwalker 1.4.4.md

wp-bootstrap-navwalker

A custom WordPress nav walker class to implement the Twitter Bootstrap 2.3.2 (https://github.com/twitter/bootstrap/) navigation style in a custom theme using the WordPress built in menu manager.

Extras

NOTE

This is a utility class that is intended to format your WordPress theme menu with the correct syntax and classes to utilize the Twitter Bootstrap dropdown navigation, and does not include the required Bootstrap JS files. You will have to include them manually.

View gist:6022669
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/AbaData-nav.png" alt="AbaData Logo" /></a>
<?php
wp_nav_menu( array(
//'sort_column' => 'menu_order',
'menu' => 'header_menu',
'depth' => 4,
'container' => false,
@twittem
twittem / gist:5161892
Last active Dec 14, 2015
A quick explanation of how to use the WordPress wp_nav_menu's fallback_cb variable.
View gist:5161892
<?php
wp_nav_menu( array(
'menu' => 'top_menu',
'depth' => 2,
'container' => false,
'menu_class' => 'nav',
//Process nav menu using our custom nav walker
'walker' => new twitter_bootstrap_nav_walker()),
'fallback_cb' => 'wp_page_menu', // No menu available: will display all pages in menu
//'fallback_cb' => '__return_false', // No menu available: no output.
View gist:4533375
<div class='row-fluid'>
<ul id='gallery-1' class='thumbnails'>
<li class='span8'>
<a class="thumbnail" href='http://localhost/Academy/wp-content/uploads/2012/12/66.jpg' title='66'>
<img width="800" height="800" src="http://localhost/Academy/wp-content/uploads/2012/12/66.jpg" alt="66" />
</a>
</li>
<li class='span4'>
<a class="thumbnail" href='http://localhost/Academy/wp-content/uploads/2012/12/11.jpg' title='11'>
<img width="800" height="800" src="http://localhost/Academy/wp-content/uploads/2012/12/11.jpg" alt="11" />
@twittem
twittem / gist:4197107
Created Dec 3, 2012
moment.js - displayEventDate
View gist:4197107
<html>
<head>
<script src="https://raw.github.com/timrwood/moment/master/moment.js"></script>
<script type="text/javascript">
function displayEventDate(startDate, endDate, alertDate){
startDate = moment.unix(startDate);
endDate = moment.unix(endDate);
var theEventDate = null;