Skip to content

Instantly share code, notes, and snippets.


Priscilla Chapman priscillamc

View GitHub Profile
View my text expander stuff
".500": "Errors like this are logged. Check the error log on your server. If you can’t find the log, please contact your host.\n\nMeantime, enable wp_debug and wp_debug_log and after an error, look at wp-content/debug.log to see if anything gets logged there.\n\nYou can also try this: Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles. \n\nIf you cannot access wp-admin, there are other ways to <a href=\"\">deactivate plugins</a>.",
".askcred": "@%clip% I've deleted your offer to login to your user's site. I'm am 100% sure you mean well but please <em>never ask for credentials on these forums.</em>\n\n<a href=\"\">
amboutwe / yoast_seo_meta_remove_dates.php
Last active Oct 5, 2020
Remove Date Meta Tags Output by Yoast SEO
View yoast_seo_meta_remove_dates.php
/* Remove Date Meta Tags Output by Yoast SEO
* Credit: Yoast development team
* Last Tested: Apr 09 2019 using Yoast SEO 10.1.3 on WordPress 5.1.1
* For Yoast SEO 14.0 or newer, please see
add_action('wpseo_dc_'.'', '__return_false'); // Premium versions 5.2 or older
amboutwe / yoast_seo_prev_next_change.php
Last active Nov 24, 2021
Remove or modify the Yoast SEO prev or next URLs. Only copy the section of code you need.
View yoast_seo_prev_next_change.php
/* Change Yoast SEO Prev/Next URL on some pages
* Credit: Yoast Team
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' );
iMazed / spamreferrals.txt
Last active Nov 5, 2020
Spam referral list to add to Google Analytics spam filters. Custom filter > Exlude > Campaign Source.
View spamreferrals.txt
adriangritz / wp-rest-api-cors.php
Last active Aug 29, 2015
How to enable CORS for WP Rest API so you can consume the API via JavaScript.
View wp-rest-api-cors.php
add_filter( 'json_serve_request', 'uf_json_serve_request' );
function uf_json_serve_request()
$domains = array('', '', '', '');
$domain = $_SERVER['HTTP_ORIGIN'];
m1r0 / wp_insert_attachment_from_url.php
Last active Sep 17, 2021
WP: Insert attachment from URL
View wp_insert_attachment_from_url.php
* Insert an attachment from an URL address.
* @param String $url
* @param Int $parent_post_id
* @return Int Attachment ID
function crb_insert_attachment_from_url($url, $parent_post_id = null) {
alexandrevicenzi / index.html
Last active Sep 22, 2020
Bootstrap CSS Animate Loading Icon Button
View index.html
<!-- Code snippet -->
<div class="form-group">
<div class="col-md-12 text-center">
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
octocat / .gitignore
Created Feb 27, 2014
Some common .gitignore configurations
View .gitignore
# Compiled source #
# Packages #
larrybotha / A.markdown
Last active Mar 15, 2021
Fix SVGs not scaling in IE9, IE10, and IE11
View A.markdown

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

aahan / WordPress Custom Global
Last active Sep 28, 2021
Creating and using custom global variables in wordpress.
View WordPress Custom Global

First create global variables (in functions.php or as a mu-plugin):


function wtnerd_global_vars() {