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 | |
/** | |
* Alter dns-prefetch links in <head> | |
*/ | |
add_filter('wp_resource_hints', function (array $urls, string $relation): array { | |
// If the relation is different than dns-prefetch, leave the URLs intact | |
if ($relation !== 'dns-prefetch') { | |
return $urls; | |
} |
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
Show hidden characters
{ | |
"presets": [ | |
[ | |
"env", | |
{ | |
"modules": false | |
} | |
] | |
], | |
"plugins": [ |
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
jQuery(document).ready(function() { | |
function metabox_category() { | |
// conditional show/hide metaboxes on checked category | |
var label = null; | |
var onemeta = jQuery('#id_of_custommetabox.postbox'); | |
// get checked checkboxes | |
var ischecked = jQuery('#taxonomy_name_categorychecklist input[type="checkbox"]:checked'); | |
var label = ischecked.parent().text().trim(); | |
//console.log(label); | |
//console.log(ischecked.length); |
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
## A script to download and archive Google search console analytics (formerly webmaster tools) | |
## | |
## searchConsoleR package created by Mark Edmondson (http://markedmondson.me) | |
## | |
## This script downloads and writes data to .csv for the most recent day of search console data (3 days ago) | |
## load the required libraries | |
## (Download them with install.packages("googleAuthR") and install.packages("searchConsoleR") if necessary | |
library(googleAuthR) | |
library(searchConsoleR) |
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
/* | |
* npm install d3 node-jsdom | |
*/ | |
var d3 = require('d3'); | |
var jsdom = require('node-jsdom'); | |
var http = require('http'); | |
function svgDOM(width, height) { | |
// Setup DOM |
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
function custom_mtypes( $m ){ | |
$m['svg'] = 'image/svg+xml'; | |
$m['svgz'] = 'image/svg+xml'; | |
return $m; | |
} | |
add_filter( 'upload_mimes', 'custom_mtypes' ); |
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 | |
// Somewhere in your header.php add this. container_class and menu_class should match the CSS main class. | |
wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'nav-menu', 'menu_class' => 'nav-menu' ) ); |
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 | |
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | |
/** | |
* video.php | |
* | |
* Requires PHP version 5.0 or more | |
* | |
* LICENSE: This source file is subject to version 3.01 of the GNU/GPL License |
NewerOlder