Skip to content

Instantly share code, notes, and snippets.

💻
Fixing things

Jeffrey Pearce jeffikus

💻
Fixing things
Block or report user

Report or block jeffikus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeffikus
jeffikus / gist:b73ea70380ad6c29aed8241c726bb5d5
Last active Apr 7, 2016 — forked from rynaldos/disable-jp-inf-scroll-cond.php
Disable Jetpack's Infinite Scroll for WooCommerce
View gist:b73ea70380ad6c29aed8241c726bb5d5
function _rsp_disable_jetpack_infinite_scroll_conditionally() {
if ( true === is_woocommerce() ) {
remove_theme_support( 'infinite-scroll' );
}
}
add_action( 'template_redirect', '_rsp_disable_jetpack_infinite_scroll_conditionally', 9 );
View gist:1692931d8051ee267bc2

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

View gist:b7ee8f385c8ac8ba40f5
<?php
/**
* I am adding this within a loop
**/
$current_user = wp_get_current_user();
// This is data that we get from the users profile, its auto-populated based on three fields.
$user_filter_criteria = get_field('user_filter_criteria', 'user_'. $current_user->ID);
View woo.js
/*
* jQuery v1.9.1 included. Go allllll the way down
*/
$(document).ready(function() {
// Removes first 3 chars from Topics list - By Jeff Pearce
function setCharAt(str,index,chr) {
if(index > str.length-1) return str;
return str.substr(0,index) + chr + str.substr(index+1);
You can’t perform that action at this time.