Skip to content

Instantly share code, notes, and snippets.

View temperatio's full-sized avatar

César temperatio

View GitHub Profile
@yunusga
yunusga / gist:33cf0ba9e311e12df4046722e93d4123
Created April 5, 2017 11:55
Debug WordPress 404 issues (permalinks, rewrite rules, etc.)
/* Produces a dump on the state of WordPress when a not found error occurs */
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */
ini_set( 'error_reporting', -1 );
ini_set( 'display_errors', 'On' );
echo '<pre>';
add_action( 'parse_request', 'debug_404_rewrite_dump' );
function debug_404_rewrite_dump( &$wp ) {
@tomfinitely
tomfinitely / acf-ms-taxonomy-field-v5.php
Created October 6, 2016 15:11
ACF Multisite Taxonomy Field (5.0+)
<?php
class acf_ms_taxonomy extends acf_field
{
/*
* __construct
*
* This function will setup the field type data
*
@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active July 13, 2024 03:08
The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

Updated on December 15th, 2021

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites. It obviously depends on your use case.

@jeherve
jeherve / jp-rm-cleaner-gallery.php
Created February 9, 2013 09:26
[Jetpack] Disable Hybrid themes' Cleaner Gallery, so that Carousel and Tiled Galleries can work http://i.wpne.ws/MkjU
@tjstein
tjstein / nginx-vhost.conf
Created April 5, 2011 00:47
nginx vhost config for WordPress + PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}