View CF7_Event_Handler_GTM.js
<script> | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
dataLayer.push({'event': 'cf7.contact-page.mailsent', 'cf7.formID': event.detail.contactFormId}); | |
}, false ); | |
</script> |
View CF7_Event_Handler.js
<script> | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
alert( "DOM Event 'wpcf7mailsent' was heard on CF7 with the Form ID: " + event.detail.contactFormId); | |
}, false ); | |
</script> |
View wp_speed_functions.php
<?php | |
// REMOVE EMOJIS | |
// Emojis are enabled by default, so if you don't want to use these you can remove the script and stylesheet: | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
// REMOVE COMMENT-REPLY.MIN.JS | |
// This is added by default to the footer, if you're not using post comments or DISQUS you can remove the script: | |
function remove_comment_reply_script(){ |
View Site-Search-JSON+LD.html
<script type="application/ld+json"> | |
{ | |
"@context": "http://schema.org", | |
"@type": "WebSite", | |
// Include your Site name within Google Search Results | |
"name" : "James' Donuts", | |
"alternateName" : "James' Donuts Ltd", | |
"url": "https://www.jamesdonuts.co.uk", | |
// Enabe the Google Sitelinks Search Box |
View .gitignore
#################################### | |
## Ignore everything except theme ## | |
#################################### | |
/* | |
### But don't ignore wp-content | |
!wp-content/ | |
### But ignore everything inside it |
View local-business-JSON-LD.js
<script type="application/ld+json"> | |
// A simple, single location local business JSON-LD Schema Boilerplate | |
// By @bavington, available on GitHub: http://bit.ly/Local_JSON | |
{ | |
"@context":"http://schema.org", | |
"@type":"Plumber", // Change to the most specific type (List of choices: https://goo.gl/tvMVHf) | |
"name":"Custom Heat", // *REQUIRED | |
"legalName":"Custom Heat Ltd", // The Registered Business Name | |
"vatID":"776796257", | |
"description":"Established in Rugby since 1980, Custom Heat are a family run central heating and plumbing business serving Rugby, Royal Leamington Spa and Warwick.", |
View wp_custom_toolbar_link.php
<?php | |
/* | |
Plugin Name: Custom Admin Bar Link | |
Plugin URI: http://www.creare.co.uk | |
Description: This simple plugin adds custom link to the Admin Bar Menu with the option of having a supporting icon. | |
Version: 0.1 | |
Author: James Bavington | |
Author URI: https://twitter.com/jamesbavington | |
*/ |
View vertical_rhythm.sass
$fz-mobile: percentage(28/1.6/16); | |
$fz-desktop: percentage(32/1.6/16); | |
$lh: 1.6rem; | |
$h1: 2rem; | |
$h2: 1.5rem; | |
$h3: 1.25rem; | |
$h4: 1rem; | |
$h5: .875rem; |
View instagram_deep_links.php
<?php | |
// Detect our key devices | |
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod"); | |
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone"); | |
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad"); | |
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android"); | |
// if iPad or iPhone, add a deep link to launch the Instagram iOS App | |
if( $iPod || $iPhone ){ ?> |
View woo_disqus.php
function disqus_embed($disqus_shortname) { | |
global $post; | |
wp_enqueue_script('disqus_embed','http://'.$disqus_shortname.'.disqus.com/embed.js'); | |
echo '<div id="disqus_thread"></div> | |
<script type="text/javascript"> | |
var disqus_shortname = "'.$disqus_shortname.'"; | |
var disqus_title = "'.$post->post_title.'"; | |
var disqus_url = "'.get_permalink($post->ID).'"; | |
var disqus_identifier = "'.$disqus_shortname.'-'.$post->ID.'"; | |
</script>'; |
NewerOlder