Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View priscillamc's full-sized avatar

Priscilla Chapman priscillamc

View GitHub Profile
{
".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 October 5, 2020 08:39
Remove Date Meta Tags Output by Yoast SEO
<?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 July 7, 2023 19:54
Remove or modify the Yoast SEO prev or next URLs. Only copy the section of code you need.
<?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 May 6, 2022 19:08
Spam referral list to add to Google Analytics spam filters. Custom filter > Exlude > Campaign Source.
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 August 29, 2015 14:26
How to enable CORS for WP Rest API so you can consume the API via JavaScript.
<?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 April 11, 2024 12:33
WP: Insert attachment from URL
<?php
/**
* Insert an attachment from a URL address.
*
* @param string $url The URL address.
* @param int|null $parent_post_id The parent post ID (Optional).
* @return int|false The attachment ID on success. False on failure.
*/
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) {
@alexandrevicenzi
alexandrevicenzi / index.html
Last active September 22, 2020 21:01
Bootstrap CSS Animate Loading Icon Button
<!-- 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 February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@larrybotha
larrybotha / A.markdown
Last active February 7, 2024 15:20
Fix SVGs not scaling in IE9, IE10, and IE11

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 March 28, 2024 19:26
Creating and using custom global variables in wordpress.

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

<?php

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