Skip to content

Instantly share code, notes, and snippets.

View iagdotme's full-sized avatar

Ian Anderson Gray iagdotme

View GitHub Profile
@iagdotme
iagdotme / fix-custom-post-type-active-menu.js
Created September 4, 2013 07:47
When you use a custom post type in WordPress the menu incorrectly chooses the "posts" menu as being active. This little jQuery script fixes that. The example below works for the Events custom post type for the Event Organiser plugin, but you can change it two whatever you like...
if ($("body").hasClass("single-event") || $("body").hasClass("tax-event-venue") || $("body").hasClass("tax-event-venue") || $("body").hasClass("tax-event-category"))
{
$("li.menu-news").removeClass("active");
$("li.menu-whats-on").addClass("active");
}
@iagdotme
iagdotme / titlechanger.html
Created May 19, 2017 09:51
Fun Title Changer
<script>
var title = document.title;
var blurMessage = [
"Please come back! :-( ",
"Don't you love me anymore? :-(",
"Fancy a cookie? ",
"I'm feeling lonely :-( ",
"I need a hug... ",
"Just checking my email...",
"Let's have a pizza party!",