Skip to content

Instantly share code, notes, and snippets.

View jrstaatsiii's full-sized avatar

Rich Staats jrstaatsiii

View GitHub Profile
@jrstaatsiii
jrstaatsiii / schema.php
Last active November 18, 2018 01:33
Schema
<?php
function schema_builder( $context ) {
$html = '<script type= "application/ld+json">';
$html .= '{';
$html .= '"@context": "http://schema.org",';
$html .= '"@type": "Organization",';
$html .= '"@name": "' . get_blog_info('name') . ',";
$html .= '"@url": "' . get_blog_info('url') . ',";
if ( $has_brand_logo ) {
<?php
// only no index all events archived
add_action('wp_head', 'no_index_event_archives', 10, 3);
function no_index_event_archives() {
if ( ! is_post_type_archive('tribe_events') )
return;
@jrstaatsiii
jrstaatsiii / glossary.json
Last active November 21, 2018 15:33
Endpoints
{
"Glossary": [{
"Term": "", // get_the_title();
"Definition": "", // get_the_content();
"Active": "", // get_field('is_active');
"Legacy_ID": "", // get_field('legacy_id');
"ID" : "" // get_the_ID();
]}
}
@jrstaatsiii
jrstaatsiii / products.json
Created November 15, 2018 00:58
Products Endpoint
{
"Product": [
{
"Description": "Cutting-edge envelope sealing technology for commercial, residential, and multi-family applications.",
"PDFResources": [
"AeroBarrier Durability Testing",
"AeroBarrier Full Line Brochure",
"AeroBarrier Overview and FAQ Flyer",
"AeroBarrier X1 Sealant Datasheet and SDS"
],
@jrstaatsiii
jrstaatsiii / hierarchal-posts.php
Created April 11, 2019 13:39
make post's hierarchal
add_filter('register_post_type_args', 'hierarchal_posts', 10, 2);
function hierarchal_posts($args, $post_type){
if ($post_type == 'post'){
$args['hierarchal'] = true;
}
return $args;
}
@jrstaatsiii
jrstaatsiii / fields.php
Last active December 14, 2019 16:19
Default Fields for SSM Projects
<?php
use StoutLogic\AcfBuilder\FieldsBuilder;
/**
* 01. Options
* a. Admin Options
* b. Background Options