Skip to content

Instantly share code, notes, and snippets.

View priscillamc's full-sized avatar

Priscilla Chapman priscillamc

View GitHub Profile
@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'];
@nickpiesco
nickpiesco / README.md
Last active March 21, 2017 22:23
Making Sass Linear Gradient Mixins Behave in IE

I wrote this fairly straightforward cross-browser linear gradient mixin:

@mixin gradient($from-color, $to-color) {
	background-color: mix($from-color, $to-color); /* Fallback */
	background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from-color), to($to-color));
	background-image: -webkit-linear-gradient(top, $from-color, $to-color); 
	background-image:    -moz-linear-gradient(top, $from-color, $to-color);
	background-image:     -ms-linear-gradient(top, $from-color, $to-color);
	background-image: -o-linear-gradient(top, $from-color, $to-color);
@ethitter
ethitter / gist:4430520
Last active May 31, 2017 16:14
WordPress MU Domain Mapping and the Customizer
Index: domain_mapping.php
===================================================================
--- domain_mapping.php (revision 688919)
+++ domain_mapping.php (working copy)
@@ -685,7 +685,7 @@
}
function redirect_to_mapped_domain() {
- global $current_blog, $wpdb;
+ global $current_blog, $wpdb, $wp_customize;
{
".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
@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>
@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
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@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
@matthiasg
matthiasg / docs style (bootstrap)
Created August 5, 2013 06:26
the callouts from the bootstrap documentation
/* Side notes for calling out things
-------------------------------------------------- */
/* Base styles (regardless of theme) */
.bs-callout {
margin: 20px 0;
padding: 15px 30px 15px 15px;
border-left: 5px solid #eee;
@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' );