Skip to content

Instantly share code, notes, and snippets.

View revaboogy's full-sized avatar

John Drummond revaboogy

View GitHub Profile
@revaboogy
revaboogy / current_page_item_class
Created February 20, 2014 16:54
Adding Class to current menu item or link
$(document).ready(function() {
// Get current url
// Select an a element that has the matching href and apply a class of 'active'. Also prepend a - to the content of the link
var url = window.location.href;
$('#main-menu a[href="'+url+'"]').addClass('current_page_item');
});
@revaboogy
revaboogy / event-category-list.php
Last active August 29, 2015 13:56 — forked from jo-snips/event-category-list.php
Category list with child categories for Wordpress Events
<?php
$terms = get_terms("tribe_events_cat", array(
'parent' => 0,
));
//print_r ($terms);
// $terms = ($terms [parent] => 0 );
$count = count($terms);
if ( $count > 0 ){
echo '<ul class="events-cat-menu">';
?>
@revaboogy
revaboogy / event-category-list.php
Last active August 29, 2015 13:56 — forked from jo-snips/event-category-list.php
Category list with child categories for Wordpress Events
<?php
$terms = get_terms("tribe_events_cat", array(
'parent' => 0,
));
//print_r ($terms);
// $terms = ($terms [parent] => 0 );
$count = count($terms);
if ( $count > 0 ){
echo '<ul class="events-cat-menu">';
?>