Skip to content

Instantly share code, notes, and snippets.

View warnakey's full-sized avatar

warnakey

View GitHub Profile
@warnakey
warnakey / ProfilePage Schema Example
Last active July 16, 2024 20:52
ProfilePage Schema Example in JSON-LD
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "ProfilePage",
"mainEntity" : {
"@type" : "Person",
"name" : "Jane Doe",
"givenName" : "Jane",
"familyName" : "Doe",
"email" : "[email protected]",
@warnakey
warnakey / index.html
Created April 15, 2019 18:27
HTML5 Blank Template (2019)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title Goes Here</title>
<meta name="description" content="Meta Description Goes Here">
<link rel="stylesheet" href="style.css">
</head>
<body>
@warnakey
warnakey / speakable-schema.php
Last active April 15, 2019 18:47
Speakable Schema Example for WordPress (will use the meta description of each page for the speakable schema)
<!-- This schema can go in the header.php file of any WordPress site -->
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "WebPage",
"name": "<?php the_title(); ?>",
"speakable":
{
"@type": "SpeakableSpecification",
"xpath": "/html/head/meta[@name='description']/@content"
<!-- This is for a single page that lists a group of products on it -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"url": "https://www.myexamplestore.com/products/",
"numberOfItems": "2",
"itemListElement": [
{
"@type": "ListItem",
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
"name": "Sentinel Primary Care",
"description": "Sentinel Primary Care is a general internal medicine practice where we provide primary care for individuals 18 years old and older. We opened our doors in 2017 to offer Triangle residents top-notch primary care services in an attentive, membership-model setting. At Sentinel we get to know each person individually to give better primary care.",
"image": "https://sentinelprimarycare.com/wp-content/uploads/2018/09/SENTINEL-logo.png",
"itemCondition": "https://schema.org/NewCondition",
"brand": { "@type": "Brand", "name": "Sentinel Primary Care" },
"aggregateRating": { "itemReviewed": "Sentinel Primary Care", "worstRating": "1", "bestRating": "5", "ratingValue": "5", "reviewCount": "3" },
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "JobPosting",
"datePosted": "2019-09-09T10:25:00-05:00",
"validThrough": "2050-09-21T09:48:00-05:00",
"title": "Crew Member",
"description": "Crew member positions include: cashiers, cooks, grill, dining room attendants, biscuit makers and drive-thru. Must be at least 16 years old. Successful candidates are passionate about customer service and serving high quality food with a smile. Candidates must be able to manage many time-sensitive tasks simultaneously, are extremely organized, have high standards of professionalism, have a positive attitude and are team players.",
"skills": "Passionate about customer service and serving high quality food with a smile. Candidates must be able to manage many time-sensitive tasks simultaneously, be extremely organized, have high standards of professionalism, have a positive attitude and are team players.",
"employmentType": "Fu
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "VideoObject",
"name": "Child Custody",
"description": "One of the most litigated issues that can arise during a divorce is child custody and visitation. North Carolina law provides that custody determinations are to be made in the best interests of the child.",
"thumbnailUrl": "https://www.divorceistough.com/wp-content/uploads/2019/03/child-custody-video-thumbnail.jpg",
"uploadDate": "2017-08-08T09:48:00-05:00",
"duration": "PT3M31S",
"contentUrl": "https://vimeo.com/228817202",
@warnakey
warnakey / functions.php
Created August 7, 2021 07:38
WooCommerce - Place Orders On Hold if billing and shipping information are different
<?php
/* PLACE ORDERS ON HOLD WHEN BILLING & SHIPPING INFO DO NOT MATCH */
add_action( 'woocommerce_thankyou', 'woocommerce_billing_shipping_address_match', 10, 1);
function woocommerce_billing_shipping_address_match( $order_id ) {
if ( ! $order_id ) {
return;
}
// Get the order id
$order = wc_get_order( $order_id );
@warnakey
warnakey / custom-klaviyo-form.html
Created August 17, 2021 00:20
Custom Klaviyo Form With Radio Buttons
<!-- REPLACE ALL INSTANCES OF "LIST_ID" WITH YOUR KLAVIYO LIST ID! THIS IS VITALLY IMPORTANT -->
<form id="contest_week_one" class="klaviyo_styling klaviyo_gdpr_embed_LIST_ID" action="//manage.kmail-lists.com/subscriptions/subscribe" data-ajax-submit="//manage.kmail-lists.com/ajax/subscriptions/subscribe" method="GET" target="_blank" novalidate="novalidate">
<input type="hidden" name="g" value="LIST_ID">
<input type="hidden" name="$fields" value="$consent">
<input type="hidden" name="$list_fields" value="$consent">
<div class="klaviyo_field_group">
<!--<label for="k_id_first_name">First Name</label>-->
<input class="" type="text" value="" name="first_name" id="k_id_first_name" placeholder="First Name" />
<!--<label for="k_id_last_name">Last Name</label>-->
<input class="" type="text" value="" name="last_name" id="k_id_last_name" placeholder="Last Name" />
<!-- You could put this in your footer.php file near the bottom -->
<!--Function to find out what time it is, so we can disable some shipping options from Friday 2pm EST through Monday at midnight EST.-->
<?php if( $post->ID == 2305 || $post->ID == 2309) { // **REPLACE** these IDs with your CART and CHECKOUT pages! *important*
// Function to get the day of the week. Returns 0 through 6. Sunday = 0, Saturday = 6.
function getWeekday($date) {
return date('w', strtotime($date));
}
// You can find out what day of the week any date is like this
// echo "The day of the week is: ";