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
/** | |
* Clears WC Cart on Page Load | |
* (Only when not on cart/checkout page) | |
*/ | |
add_action( 'wp_head', 'bryce_clear_cart' ); | |
function bryce_clear_cart() { | |
if ( wc_get_page_id( 'cart' ) == get_the_ID() || wc_get_page_id( 'checkout' ) == get_the_ID() ) { | |
return; | |
} |
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
#Al tener un SSL con SNI o Let's Encrypt, redsys no devuelve bien el estado del pedido pago y lo deja "En Espera" | |
#Esto se produce porque redsys no es compatible con estos protocolos, por lo tanto hay que saltear el https: en la | |
#respuesta de redsys. La solución es en el plugin (https://wordpress.org/plugins/woocommerce-sermepa-payment-gateway/) | |
#elegir el Protocolo para notificaciones HTTP y en el .htacces añadir una exclusión a la regla que redirige de | |
#HTTP a HTTPS. | |
# Enviar trafico HTTP a HTTPS | |
RewriteEngine On | |
# Si la cadena de consulta no contiene wc-api=WC_MyRedsys | |
RewriteCond %{QUERY_STRING} !wc-api=WC_MyRedsys [NC] |
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 | |
/* Add fields to account page */ | |
add_action('um_after_account_general', 'showExtraFields', 100); | |
function showExtraFields() | |
{ | |
$custom_fields = [ | |
"alternate_email" => "Permanent E-mail Address", | |
"major" => "Major", | |
"minor" => "Minor", | |
"gpa" => "GPA", |
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
# ---------- Status Cats Error Pages!!! via: https://http.cat/ --------- | |
# | |
# requires that a dns resolver be set for nginx as in: resolver 127.0.0.1; | |
# typically uses dnsmasq for 127.0.0.1 resolver | |
# | |
# Usage: | |
# place this file somewhere accessible to nginx. /etc/nginx/snippets is a decent choice. | |
# then inside the server block(s) you want cat themed error status responses do: | |
# include snippets/http-cat-error-pages.conf | |
# |
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
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
// See also: http://www.paulund.co.uk/change-url-of-git-repository | |
$ cd $HOME/Code/repo-directory | |
$ git remote rename origin bitbucket | |
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git | |
$ git push origin master | |
$ git remote rm bitbucket |
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
/* Get featured image */ | |
if( !function_exists( 'get_the_post_thumbnail_by_blog' ) ) { | |
function get_the_post_thumbnail_by_blog($blog_id=NULL,$post_id=NULL,$size='post-thumbnail',$attrs=NULL) { | |
global $current_blog; | |
$sameblog = false; | |
if( empty( $blog_id ) || $blog_id == $current_blog->ID ) { | |
$blog_id = $current_blog->ID; | |
$sameblog = true; | |
} |
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
" ---------------------- USABILITY CONFIGURATION ---------------------- | |
" Basic and pretty much needed settings to provide a solid base for | |
" source code editting | |
" don't make vim compatible with vi | |
set nocompatible | |
" turn on syntax highlighting | |
syntax on | |
" and show line numbers |
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 replace_open_sans() { | |
// Kill the original style | |
wp_deregister_style('open-sans'); | |
// Replace it with your own (just as an example, I included only the 300 weight) | |
wp_register_style( 'open-sans', 'http://fonts.googleapis.com/css?family=Open+Sans:300' ); | |
wp_enqueue_style( 'open-sans'); | |
} | |
add_action( 'wp_enqueue_scripts', 'replace_open_sans' ); | |
// Thanks to @timkinnane | |
add_action( 'admin_enqueue_scripts', 'replace_open_sans' ); |
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 | |
/** | |
* How to filter the value that would be returned by get_post_thumbnail_id() | |
*/ | |
add_filter( 'get_post_metadata', function ( $value, $post_id, $meta_key, $single ) { | |
// We want to pass the actual _thumbnail_id into the filter, so requires recursion | |
static $is_recursing = false; | |
// Only filter if we're not recursing and if it is a post thumbnail ID |
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
# HTTP Status Cats | |
# Apache (htaccess) config created by @dave1010 | |
# Licensed CC BY 2.0 | |
# Images CC BY 2.0, from GirlieMac's photostream: | |
# http://www.flickr.com/photos/girliemac/sets/72157628409467125/with/6508023065/ | |
# Usage: copy save this file as .htaccess or add it to your httpd.conf | |
ErrorDocument 404 '<a href="http://www.flickr.com/photos/girliemac/6508022985/" title="404 - Not Found by GirlieMac, on Flickr"><img src="http://farm8.staticflickr.com/7172/6508022985_b22200ced0.jpg" width="500" height="400" alt="404 - Not Found"></a>' |
NewerOlder