I have a small jQuery snippet that executes when a WordPress post has the body class expired. It hides certain elements and works fine when I am logged in but when I am logged out it keeps throwing a JQuery - $ is not defined error.
var $=jQuery.noConflict();
$(document).ready(function () {
jQuery(function ($) {
if ($("body").hasClass("expired")) {
$('.button-link').css('display', 'none !important');
$(".countdown-wrapper").hide();
$(".button-link").hide();
$(".size-default").hide();
}
});
});
Any WordPress experts out there could maybe point me in the right direction?