⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
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
title: Example Blueprint | |
fields: | |
elastic: | |
label: Search | |
type: elastic |
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 | |
// Init | |
// ----------------------------------------------------------------------- | |
define('DOING_AJAX', true); | |
define('SHORTINIT', true); | |
// WP Load | |
// ----------------------------------------------------------------------- | |
require('wp-load.php'); |
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 | |
//Not original code, just don't want to loose it | |
// fill in your Constant Contact login and API key | |
$ccuser = get_theme_mod( 'ccuser' ); | |
$ccpass = get_theme_mod( 'ccpass' ); | |
$cckey = get_theme_mod( 'key' ); | |
// fill in these values | |
$firstName = ""; | |
$lastName = ""; |
In the case where you manually want to decorate a link with the linker parameter, i.e. the link is not a valid anchor link, or the final tracking page is accessed by user in a non direct way: File Download, Extension Installation, ect...
/**
* Returns the Google Analytics tracker linker parameter.
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 if( ! defined( 'ABSPATH' ) ) { die(); } | |
/** | |
* Plugin Name: Disable Attachment Pages | |
* Plugin URI: https://gschoppe.com/wordpress/disable-attachment-pages | |
* Description: Completely disable attachment pages the right way. No forced redirects or 404s, no reserved slugs. | |
* Author: Greg Schoppe | |
* Author URI: https://gschoppe.com/ | |
* Version: 1.0.0 | |
**/ |
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
# To enable CORS you should add lines with CORS rules below to your valet.conf file | |
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx | |
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory | |
# after you edit your valet.conf do not forget to execute `valet restart` | |
server { | |
listen 80 default_server; | |
root /; | |
charset utf-8; | |
client_max_body_size 128M; |
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 | |
$items_per_page = 2; | |
$page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1; | |
$offset = ( $page * $items_per_page ) - $items_per_page; | |
$query = 'SELECT * FROM '.$table_name; | |
$total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table"; | |
$total = $wpdb->get_var( $total_query ); |
NewerOlder