Skip to content

Instantly share code, notes, and snippets.

View wurwal's full-sized avatar

Thomas Wurwal wurwal

  • Rawww
  • Coventry
View GitHub Profile
<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;
}
{"id":0,"name":"root","depth":0,"children":[{"id":2,"name":"ct_div_block","options":{"ct_id":2,"ct_parent":0,"selector":"div_block-2-106","original":{"image_type":"2","attachment_size":"full","min-height":"300","width-unit":"%","width":"100","padding-bottom":"30","position":"relative"},"nicename":"swiper","classes":["swiper"],"activeselector":false},"depth":1,"children":[{"id":10,"name":"ct_div_block","options":{"ct_id":10,"ct_parent":2,"selector":"div_block-10-106","original":{"image_type":"2","attachment_size":"full","position":"absolute","top":"46","top-unit":"%","left":"10"},"nicename":"swiper-prev","classes":["swiper-button-prev"],"activeselector":false},"depth":2},{"id":13,"name":"ct_div_block","options":{"ct_id":13,"ct_parent":2,"selector":"div_block-13-106","original":{"image_type":"2","attachment_size":"full","position":"absolute","top-unit":"%","top":"46","right":"0"},"nicename":"swiper-next","classes":["swiper-button-next"],"activeselector":false,"ct_content":""},"depth":2},{"id":7,"name":"ct_div_b
@wurwal
wurwal / icon fix
Created June 20, 2022 14:49
replacing <i> elements with svg so that they render within owl carousel on mobile
<!-- 1. add attached "icon-global.svg" to /img/home/icons -->
<!-- 2. replace all instances of below html within div id "owl-cover-usp" -->
<i class="icon-icons_globe waypoint"></i>
<!-- with... -->
<img class="owl-usp-icon" src="img/home/icons/icon-global.svg" alt="USP Icon">
<!--Replace the home-intro <section> of each sub page using the html snippets below-->
<!-- Already Travelling -->
<section class="home-intro">
<div class="home-intro-inner">
<h1>Travel Insurance when already abroad</h1>
<p>If you're already travelling and need insurance, you can get covered here, right now</p>
</div>
@wurwal
wurwal / home-page.html
Last active June 14, 2022 12:49
True Traveller Home page Cover video update
<!-- 1. extract attached "icons.zip" to /img/home/icons -->
<!-- 2. add attached "home-page-redesign.css" to /css/ -->
<!-- 3. add this stylesheet link to <head> below where all.css is called -->
<link rel="stylesheet" href="css/home-page-redesign.css">
<!-- 4. replace home-intro <section> with below -->