Skip to content

Instantly share code, notes, and snippets.

Avatar

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. https://wordpress.org/support/article/debugging-in-wordpress/\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=\"https://wordpress.org/support/article/faq-troubleshooting/#how-to-deactivate-all-plugins-when-not-able-to-access-the-administrative-menus\">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=\"https://wordpress.org/support/guidelines/#the-bad-stuff\">https://wordpress.org
@amboutwe
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
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* 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 https://yoast.com/help/date-appears-search-results/#h-managing-dates
*/
add_action('wpseo_dc_'.'DC.date.issued', '__return_false'); // Premium versions 5.2 or older
@amboutwe
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
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* 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
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
share-buttons.xyz
traffic2cash.xyz
с.новым.годом.рф
net-profits.xyz
social-widget.xyz
free-social-buttons.xyz
4webmasters.org
76brighton.co.uk
7makemoneyonline.com
acads.net
@adriangritz
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
<?php
//http://torquemag.io/preparing-wordpress-site-power-single-page-web-app/
add_filter( 'json_serve_request', 'uf_json_serve_request' );
function uf_json_serve_request()
{
$domains = array('http://warrington.ufl.edu', 'https://warrington.ufl.edu', 'http://beta.warrington.ufl.edu', 'https://beta.warrington.ufl.edu');
$domain = $_SERVER['HTTP_ORIGIN'];
@m1r0
m1r0 / wp_insert_attachment_from_url.php
Last active Sep 17, 2021
WP: Insert attachment from URL
View wp_insert_attachment_from_url.php
<?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
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>
</div>
</div>
@octocat
octocat / .gitignore
Created Feb 27, 2014
Some common .gitignore configurations
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@larrybotha
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
aahan / WordPress Custom Global Variables.md
Last active Sep 28, 2021
Creating and using custom global variables in wordpress.
View WordPress Custom Global Variables.md

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

<?php

/*
 * CUSTOM GLOBAL VARIABLES
 */
function wtnerd_global_vars() {