Dropbox are removing support for the Public folder functionality.
I have written a drop-in script replacement for your Dropbox public folder links.
Download the script and follow the development on GitHub:
Dropbox are removing support for the Public folder functionality.
I have written a drop-in script replacement for your Dropbox public folder links.
Download the script and follow the development on GitHub:
If you are using the WordPress Stream plugin and have a reverse proxy like Varnish in front of it, you might be seeing the IP of your Varnish machines rather than the client IP. This snippet lets you set the proper IP address that Varnish or other reverse proxies forward.
This code only works for Apache. If you are running Nginx you will need the getallheaders polyfill.
//Add proper forwarded IP to log records add_filter('wp_stream_record_array', function($record) { //Get proper IP if(function_exists('getallheaders')) { $headers = getallheaders(); //Exchange IP if header set if(isset($headers['X-Forwarded-For'])) { $record['ip'] = filter_var($headers['X-Forwarded-For'], FILTER_VALIDATE_IP); } } return $record; });
The official Debian 8 documentation for VMWare instructs you to install the open-vm-tools
package, but it omits that you actually also need to install the separate open-vm-tools-desktop package
to get window resizing working. Simply run:
apt-get install open-vm-tools open-vm-tools-desktop
If you are upgrading Deployer from version 3 to 4 you will see issues when trying to deploy, for example:
[ERROR] Error: Call to undefined function set() in /Users/stakhr/site/deploy.php:5 Stack trace: #0 phar:///Users/stakhr/site/deployer.phar/bin/dep(114): require() #1 phar:///Users/stakhr/site/deployer.phar/bin/dep(115): {closure}() #2 /Users/stakhr/site/deployer.phar(4): require('phar:///Users/s...') #3 {main}
To fix these issues, you need to do a few things:
deploy.php
file, like this: namespace Deployer;
env()
function has been deprecated. Replace it with set()
when setting variables (two parameters) and get()
when getting variables (one parameter)set('ssh_type', 'native');
to fix the nag that shows up.Here is a full example of deploying a WordPress site using Deployer 4
PS. I’ve also noted that running deployer self-update
on version 3 does not upgrade to version 4.
Say that you have multiple log files for Nginx, Apache or any other software that you would like to tail. You can do this easily with tail
like so:
Nginx
tail -f /var/log/nginx/*.log
Apache
tail -f /var/log/apache2/*.log
You need to have a fairly recent version of tail
to use this. It works on Ubuntu 16.04 with tail
version 8.25.
Reinstall plugins
wp plugin install $(wp plugin list --field=name) --force
Reinstall themes
wp theme install $(wp theme list --field=name) --force
I wanted to create a simple dynamic slider using Advanced Custom Fields, but Soliloquy does not have this option out of the box. After poking around the source of Soliloquy I found the filter soliloquy_custom_slider_data
which lets us add our own slider data. Here is the required code to dynamically generate a slider. (This code is not ACF-specific, you can use any data source.)
Your slider will be available using the shortcode:
[soliloquy type="frontpage"]
The code to generate this dynamic slider:
add_filter('soliloquy_custom_slider_data', function($data, $atts, $post) { //Bail early if not our slider type if(isset($atts['type']) && $atts['type'] !== 'frontpage') { return $data; } $data_dynamic = [ 'id' => 0, 'slider' => [ //This is where you enter all your dynamic slides! //72 and 73 below are the IDs of the image attachments used in the slider. 72 => [ 'status' => 'active', 'id' => 72, 'attachment_id' => 72, 'title' => 'Image title', 'link' => 'http://example.com', 'alt' => 'Alt text', 'caption' => 'Caption', 'type' => 'image', 'linktab' => 0 ], 73 => [ 'status' => 'active', 'id' => 73, 'attachment_id' => 73, 'title' => 'Image title', 'link' => 'http://example.com', 'alt' => 'Alt text', 'caption' => 'Caption', 'type' => 'image', 'linktab' => 0 ] ], 'config' => [ //This is the general slider config 'type' => 'default', 'slider_theme' => 'base', 'slider_width' => 1080, 'slider_height' => 400, 'transition' => 'fade', 'duration' => 5000, 'speed' => 400, 'gutter' => 20, 'slider' => 1, 'aria_live' => 'polite', 'classes' => [ 'frontpage-slider' ], 'title' => '', 'slug' => '', 'rtl' => 0 ] ]; return $data_dynamic; }, 11, 3);
I am using Soliloquy Lite, although I’m sure this works with the paid options as well. You can also easily create multiple dynamic sliders, each pulling data from different sources.
EasyEngine provides you with 1GB of swap space by default, but sometimes you’d like a little bit more. Here is how you can increase the swap space:
Edit /etc/dphys-swapfile
and set the following:
CONF_SWAPSIZE=2000 CONF_MAXSWAP=2000
Run:
dphys-swapfile swapoff dphys-swapfile setup dphys-swapfile swapon
That’s it! Verify your new swap space with htop
or top
Example of adding styles from a theme. The code below works on frontend (if you are using acf_form()) as well as in the backend.
add_filter( 'tiny_mce_before_init', function($mce_init) { $content_css = get_stylesheet_directory_uri() . '/your-custom-css.css'; if (isset($mce_init[ 'content_css' ])) { $mce_init[ 'content_css' ] = "{$mce_init['content_css']},{$content_css}"; } return $mce_init; });
The Bose QC25 are great-sounding headphones. However the bass is way too heavy, which results in a muddled midsection. By bringing the lower frequencies down a bit and increasing high frequencies, you will get a much more balanced sounds profile. Simply tweak your equalizer according to the graph above and to your personal preference.
If you use foobar2000 you can download the exact preset here for the foo_dsp_xgeq component here.