Skip to content

Instantly share code, notes, and snippets.

View SideQuestDIY's full-sized avatar
💭
introducing bugs into production.

Edward McIntyre SideQuestDIY

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

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.

<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,
@SideQuestDIY
SideQuestDIY / gist:5161892
Last active December 14, 2015 22:58
A quick explanation of how to use the WordPress wp_nav_menu's fallback_cb variable.
<?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.
<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" />
@SideQuestDIY
SideQuestDIY / gist:4197107
Created December 3, 2012 18:57
moment.js - displayEventDate
<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;