This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if we are in a local environment | |
function is_localhost() { | |
// set the array for testing the local environment | |
$whitelist = array( '127.0.0.1', '::1' ); | |
// check if the server is in the array | |
if ( in_array( $_SERVER['REMOTE_ADDR'], $whitelist ) ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Table of Contents: Analytics | |
============================ | |
1.0 - Functions | |
2.0 - Processing | |
**/ | |
/* globals consoleMessage, ga, ready, forEachElement, checkForParent */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks if console exists and allows command types for output. | |
* | |
* @param {comman.['log', 'warn', 'error', 'info']} console command type | |
* @param {message.string} Message to be passed to the console type | |
* @return cosole.[command]([message]) if console available | |
*/ | |
function consoleMessage(command, message) { | |
'use strict'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Screen Reader Text | |
========== | |
Apply to text meant only for screen readers. | |
Usage | |
========= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Screen Reader Text | |
========== | |
Apply to text meant only for screen readers. | |
Usage | |
========= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The functions to add all ACF types to the REST API responses. | |
* | |
* @link https://developer.wordpress.org/reference/hooks/rest_prepare_post_type/ | |
* @package theme-name | |
*/ | |
/** | |
* Add Options for Posts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The functions to add all ACF types to the REST API responses. | |
* | |
* @link https://developer.wordpress.org/reference/hooks/rest_prepare_post_type/ | |
* @package theme-name | |
*/ | |
/** | |
* Add Options for Posts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// only run this in the admin section | |
if ( is_admin() ) { | |
/* Run this function after theme setup. Did not use 'after_switch_theme' | |
* to allow for future automatic additions to existing sites. | |
*/ | |
add_action( 'after_setup_theme', '_starter_page_add' ); | |
// get the support page function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wrap the first word of the site title matching 'string' in a span to apply highlight color | |
function siteAcronymClass(acronym) { | |
var strTitle = document.getElementsByClassName('site-title')[0].innerHTML; | |
var newStrTitle = strTitle.replace(acronym, '<span class="site-acronym">' + acronym + '</span>'); | |
if ( strTitle !== null ) { | |
document.getElementsByClassName('site-branding-title')[0].innerHTML = newStrTitle; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove the sharing functions for jetpack from the excerpt or content. | |
*/ | |
function jetpack_modify_remove_excerpt_share() { | |
// Remove from exceprt. | |
remove_filter( 'the_excerpt', 'sharing_display',19 ); | |
// Remove from page. | |
remove_filter( 'the_content', 'sharing_display',19 ); |
NewerOlder