Skip to content

Instantly share code, notes, and snippets.

View wurwal's full-sized avatar

Thomas Wurwal wurwal

  • Rawww
  • Coventry
View GitHub Profile
//REDIRECTS DRAFTED WHATS ON POSTS TO BASE CATEGORY PAGE
add_action('template_redirect', 'redirect_draft_post_in_category');
function redirect_draft_post_in_category() {
if (is_singular('post')) {
global $post;
// Check if the post is a draft
if ($post->post_status === 'draft') {
<?php
/**
* The template for displaying product content in the single-product.php template
*
* This template can be overridden by copying it to yourtheme/woocommerce/content-single-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
jQuery(".pin-0").click(function(){
point = 0;
jQuery(".infobox").removeClass("show-flex");
jQuery(".pin").attr("src","https://tribe-manchesterairport.co.uk/wp-content/uploads/2025/04/pin.svg");
jQuery(".infobox-0").addClass("show-flex");
jQuery(".pin-0").attr("src","https://tribe-manchesterairport.co.uk/wp-content/uploads/2025/04/pin-active.svg");
});
jQuery(".pin-1").click(function(){
@wurwal
wurwal / gist:cbc4f8210107374fbbb7afea221cd6a5
Created April 16, 2025 17:40
Oxygen gutenburg image click fix
.wp-block img:not([draggable]), .wp-block svg:not([draggable]) {
pointer-events: all !important;
}
<script>
jQuery(document).ready(function() {
// Function to retrieve cookie value by name
function getCookie(name) {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].trim();
// Check if this cookie is the one we are looking for
if (cookie.indexOf(name + '=') === 0) {
<script>
jQuery(document).ready(function() {
// When the document is ready
// Bind a click event to the submit button
jQuery('#insert-submit-button').click(function(event) {
<!-- mega menu start (items are in reverse order in markup)-->
<li class="mega-menu menu-search">
<a href="#"><img class="search-button" src="<?php bloginfo('template_directory'); ?>/assets/images/icon-search.png"/></a>
<ul class="menu animated fadeIn">
<li>
<div class="medium-12 column">
<?php echo do_shortcode("[wd_asp id=1]"); ?>
</div>
</li>
@wurwal
wurwal / gist:08bd642c8844ea15b7681909f3b87eb3
Created February 3, 2023 18:33
detect no posts on repeaters with or without facetwp
//when facets change dynamically - delete if using on a regular page load based repeater
jQuery(document).on('facetwp-loaded', function() {
// if repeater id contains something that it would if it returned posts
if (jQuery('#_dynamic_list-9-148 h2').length > 0) {
// hide no posts error
jQuery('.no-results').hide();
// otherwise the no results message shows
}
@wurwal
wurwal / peel.html
Created October 18, 2022 12:56
Peel CRM embed code
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<form class="contact-form" id="__vtigerWebForm" name="Detertech - leads" action="https://pid-systems.co.uk/crm/modules/Webforms/capture.php" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<input type="hidden" name="__vtrftk" value="sid:74f1302d01d32a4fae77eefe2259b322de8d384b,1664895530" />
<input type="hidden" name="publicid" value="a9f27047575e4dad9d1326c5b0a80349" />
<input type="hidden" name="urlencodeenable" value="1" /><input type="hidden" name="name" value="Detertech - leads" />
<input class="input-text odd" placeholder="First Name*" type="text" name="firstname" data-label="" value="" required="" />
<input class="input-text even" placeholder="Last Name*" type="text" name="lastname" data-label="" value="" required="" />
<input class="input-text odd" placeholder="Business Name*" type="text" name="company" data-label="" value="" required="" />
<
@wurwal
wurwal / gist:6bbba82f848b5deb03ce1629c7b52f24
Created August 24, 2022 09:28
Make clamp defined headers and body copy appear at a reasonable size in oxygen
Paste into Admin MU
/*show clamp defined typo size in gutenburg at a reasonable size*/
.editor-styles-wrapper {
font-size: 120%!important;
}
html {
font-size: 62.5%!important;
}