Skip to content

Instantly share code, notes, and snippets.

View inetbiz's full-sized avatar
💭
Honing my JSON+LD Structured Data Skills

Denver Prophit Jr. inetbiz

💭
Honing my JSON+LD Structured Data Skills
View GitHub Profile
@inetbiz
inetbiz / BreadCrumbs.html
Last active September 24, 2021 16:05
Jekyll Schema BreadCrumbs in JSON Format
"breadcrumb": {
"@type": "BreadcrumbList",
"itemListElement": [
{% assign crumbs = page.url | remove:'/index.html' | split: '/' %} {% assign crumbs_total = crumbs | size | minus: 1 %}{% for crumb in crumbs offset: 1 %}{% if forloop.index == crumbs_total %}
{
"@type": "ListItem",
"position": "{{ forloop.index }}",
"item": {
"@id": "{{ site.url }}{{ page.url }}",
"name": "{{ page.crumbtitle}}"
@inetbiz
inetbiz / gtag.html
Last active August 19, 2021 14:44
Google Tag - User Timings
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx-xx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('set',{'content_group1':'{{page.title}}'});
if (window.performance) {
var timeSincePageLoad = Math.round(performance.now());
gtag('event', 'timing_complete', {
@inetbiz
inetbiz / rv-camphost.json
Last active September 19, 2020 14:34
RV / Caravan Park Lodging Business JSON+LD
{
"@context": "https://schema.org/",
"@type": [
"LodgingBusiness",
"CampGround"
],
"@id": "#brand",
"sameAs": [
"http://www.facebook.com/your-profile",
"http://www.twitter.com/yourProfile",
@inetbiz
inetbiz / functions.php
Created August 14, 2019 11:36
WordPress Function: Number of Words in Post Content
function post_word_count() {
$count = 0;
$posts = get_posts( array(
'numberposts' => -1,
'post_type' => array( 'post', 'page' )
));
foreach( $posts as $post ) {
$count += str_word_count( strip_tags( get_post_field( 'post_content', $post->ID )));
}
$num = number_format_i18n( $count );
@inetbiz
inetbiz / attorney.txt
Created August 13, 2019 18:31
Jekyll AUthor Social Profiles via nested data yaml
attorney2:
birth_country: "United States of America"
birth_city: "Paso Robles"
birth_region: CA
birth_zip: 93446
education: "Southeastern University: B.A. History – 2008, University of Florida Levin College of Law: Juris Doctor – 2011"
first_name: attorney
last_name: One
honorary: Esq
nationality: "United States of America"
@inetbiz
inetbiz / post.html
Last active March 31, 2019 14:28
Jekyll Article JSON+LD
---
layout: default
---
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"url": "{{ site.url }}{{ page.url }}",
"name": "{{ page.title | jsonify }}",
"headline": "{{ page.title | jsonify }}",
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CollectionPage",
"name": "Page Title",
"url": "URL of Page",
"description": "Meta Description",
"mainEntity": {
"@type": "ItemList",
"itemListElement": [
<?php
/**
* Plugin Name: Endo Stock Report Exporter
* Plugin URI: http://www.endocreative.com
* Description: A custom stock report exporter plugin for WooCommerce
* Version: 1.0.0
* Author: Endo Creative
* Author URI: http://www.endocreative.com
* License: GPL2
*/
@inetbiz
inetbiz / .htaccess
Last active August 24, 2021 18:37
WordPress Security & Optimization in htaccess and Robots.txt
# BEGIN WordPress https://wordpress.org/support/article/htaccess/
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
Allow [ Trusted Domains/IPs ]
</Files>
# FINISH XML RPC BLOCKING
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
@inetbiz
inetbiz / social-figure.html
Last active June 21, 2017 10:13
social schema markup on a figure
<figure itemid="https://www.pinterest.com/pin/201887995769400347/" itemscope itemtype="http://schema.org/SocialMediaPosting">
<link itemtype="headline" itemref="#headline" />
<img src="..." itemprop="image" />
<blockquote cite="https://www.pinterest.com/pin/201887995769400347/">
<h3 itemprop="headline">Leaked new BMW 2 series (m235i) ahead of oct 25 reveal</h3>
<p>Date posted: March 4, 2014 <meta itemprop="datePublished" content="2014-03-04" /></p>
<p>Author:
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">
<a itemprop="url" href="https://www.pinterest.com/ryansammy/">Ryan Sammy</a></span>