Skip to content

Instantly share code, notes, and snippets.

Avatar
🏀
Focusing

Faruk Garić farukgaric

🏀
Focusing
View GitHub Profile
@farukgaric
farukgaric / virtual_online_event_schemaorg.html
Created Sep 19, 2020
Virtual (Online) Event - Structured data - Schema.org - JSON-LD
View virtual_online_event_schemaorg.html
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-07-21T19:00:00-05:00",
"endDate": "2025-07-21T23:00-05:00",
@farukgaric
farukgaric / plugin.php
Last active Aug 27, 2020
WordPress Block Patterns - Listicle
View plugin.php
/**
* Plugin Name: FG Patterns
* Plugin URI: https://www.farukgaric.com/
* Description: Various block patterns
* Version: 1.0.0
* Author: Faruk Garic
* Author URI: https://www.farukgaric.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: fg-patterns
@farukgaric
farukgaric / person_jsonld.html
Created May 10, 2020
Structured data - Person (json-ld)
View person_jsonld.html
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "John Doe",
"jobTitle": "Graduate research assistant",
"affiliation": "University of Dreams",
"additionalName": "Johnny",
"url": "http://www.example.com",
"address": {
@farukgaric
farukgaric / person_microdata.html
Created May 10, 2020
Structured data - Person (microdata)
View person_microdata.html
<section itemscope itemtype="http://schema.org/Person">
Hello, my name is
<span itemprop="name">John Doe</span>,
I am a
<span itemprop="jobTitle">Graduate research assistant</span>
at the
<span itemprop="affiliation">University of Dreams</span>
My friends call me
<span itemprop="additionalName">Johnny</span>
You can visit my homepage at
@farukgaric
farukgaric / function.php
Created Mar 26, 2020
Here is a simple snippet by @pbosakov that needs to be placed in function.php file in order to move all your events online due to COVID-19.
View function.php
/* all events moved online due to COVID-19 */
if (!function_exists('custom_event_schema_extras')) {
function custom_event_schema_extras($_data, $args, $event) {
$_data->eventStatus = 'EventMovedOnline';
$_data->eventAttendanceMode = 'OnlineEventAttendanceMode';
return $_data;
}
add_filter('tribe_json_ld_event_object', 'custom_event_schema_extras', 10, 3);
}
View event_moved_online.html
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-08-21T19:00",
"endDate": "2025-08-21T23:00",
@farukgaric
farukgaric / event_rescheduled.html
Last active Mar 25, 2020
Structured data: Event rescheduled
View event_rescheduled.html
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-08-21T19:00",
"endDate": "2025-08-21T23:00",
@farukgaric
farukgaric / event_postponed.html
Created Mar 25, 2020
Structured data: Postponed event
View event_postponed.html
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-07-21T19:00",
"endDate": "2025-07-21T23:00",
@farukgaric
farukgaric / event_cancelled.html
Created Mar 25, 2020
Structured data: Cancelled event
View event_cancelled.html
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-07-21T19:00",
"endDate": "2025-07-21T23:00",
@farukgaric
farukgaric / event_scheduled.html
Created Mar 25, 2020
Structured data: Just normal scheduled event
View event_scheduled.html
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-07-21T19:00",
"endDate": "2025-07-21T23:00",
You can’t perform that action at this time.